From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: Re: [PATCH, take2] netfilter : struct xt_table_info diet Date: Tue, 20 Nov 2007 08:50:15 +0100 Message-ID: <474291B7.6060602@trash.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Simon Horman , dada1@cosmosbay.com, davem@davemloft.net, netdev@vger.kernel.org, netfilter-devel@lists.netfilter.org To: Herbert Xu Return-path: Received: from stinky.trash.net ([213.144.137.162]:56398 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759614AbXKTHuU (ORCPT ); Tue, 20 Nov 2007 02:50:20 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Herbert Xu wrote: > Simon Horman wrote: > >> @@ -269,9 +269,12 @@ struct xt_table_info >> unsigned int underflow[NF_INET_NUMHOOKS]; >> >> /* ipt_entry tables: one per CPU */ >> - char *entries[NR_CPUS]; >> + /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ >> + char *entries[1]; >> > > Just do > > char *entries[]; > > Not only is it ISO C99, but the compiler will die if it's not at > the end. > > Actually I haven't read the rest of the patch, so scratch this > comment if you really need to have one entry there for some reason :) > I thought this too, but its needed for the bootstrap tables, which are declared on the stack :)