All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: coreteam@netfilter.org,  netfilter-devel@lists.netfilter.org
Subject: Re: [netfilter-core] [PATCH 2.6.7] ip_table_raw C99 initialization
Date: Thu, 17 Jun 2004 15:07:24 +0200	[thread overview]
Message-ID: <40D1978C.3040406@trash.net> (raw)
In-Reply-To: <20040616160921.2727a57c@dell_ss3.pdx.osdl.net>

Stephen Hemminger wrote:
> Sparse didn't like the construct in iptables_raw
> 	{[NF_IP_XXX] 0,
> because it was an old GNU style initializer.
> So I bit the bullet and redid the initial_table as full C99.
> Builds okay, but please check it before applying.

Thanks Stephen, entry was missing from the ERROR part, I've fixed it
and will pass the patch on to Harald.

Regards
Patrick

> 
> Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
> 
> diff -Nru a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c
> --- a/net/ipv4/netfilter/iptable_raw.c	2004-06-16 16:05:40 -07:00
> +++ b/net/ipv4/netfilter/iptable_raw.c	2004-06-16 16:05:40 -07:00
> @@ -32,43 +32,60 @@
>  	struct ipt_replace repl;
>  	struct ipt_standard entries[2];
>  	struct ipt_error term;
> -} initial_table __initdata
> -= { { "raw", RAW_VALID_HOOKS, 3,
> -      sizeof(struct ipt_standard) * 2 + sizeof(struct ipt_error),
> -      { [NF_IP_PRE_ROUTING] 0,
> -	[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) },
> -      { [NF_IP_PRE_ROUTING] 0,
> -	[NF_IP_LOCAL_OUT] sizeof(struct ipt_standard) },
> -      0, NULL, { } },
> -    {
> -	    /* PRE_ROUTING */
> -	    { { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
> -		0,
> -		sizeof(struct ipt_entry),
> -		sizeof(struct ipt_standard),
> -		0, { 0, 0 }, { } },
> -	      { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
> -		-NF_ACCEPT - 1 } },
> -	    /* LOCAL_OUT */
> -	    { { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
> -		0,
> -		sizeof(struct ipt_entry),
> -		sizeof(struct ipt_standard),
> -		0, { 0, 0 }, { } },
> -	      { { { { IPT_ALIGN(sizeof(struct ipt_standard_target)), "" } }, { } },
> -		-NF_ACCEPT - 1 } }
> -    },
> -    /* ERROR */
> -    { { { { 0 }, { 0 }, { 0 }, { 0 }, "", "", { 0 }, { 0 }, 0, 0, 0 },
> -	0,
> -	sizeof(struct ipt_entry),
> -	sizeof(struct ipt_error),
> -	0, { 0, 0 }, { } },
> -      { { { { IPT_ALIGN(sizeof(struct ipt_error_target)), IPT_ERROR_TARGET } },
> -	  { } },
> -	"ERROR"
> -      }
> -    }
> +} initial_table __initdata = {
> +	.repl = {
> +		.name = "raw", 
> +		.valid_hooks = RAW_VALID_HOOKS, 
> +		.num_entries = 3,
> +		.size = sizeof(struct ipt_standard) * 2 + sizeof(struct ipt_error),
> +		.hook_entry = { 
> +			[NF_IP_PRE_ROUTING] = 0,
> +			[NF_IP_LOCAL_OUT] = sizeof(struct ipt_standard) },
> +		.underflow = { 
> +			[NF_IP_PRE_ROUTING] = 0,
> +			[NF_IP_LOCAL_OUT]  = sizeof(struct ipt_standard) },
> +	},
> +	.entries = {
> +	     /* PRE_ROUTING */
> +	     { 
> +		     .entry = { 
> +			     .target_offset = sizeof(struct ipt_entry),
> +			     .next_offset = sizeof(struct ipt_standard),
> +		     },
> +		     .target = { 
> +			  .target = { 
> +				  .u.target_size = IPT_ALIGN(sizeof(struct ipt_standard_target)),
> +			  },
> +			  .verdict = -NF_ACCEPT - 1,
> +		     },
> +	     },
> +
> +	     /* LOCAL_OUT */
> +	     {
> +		     .entry = {
> +			     .target_offset = sizeof(struct ipt_entry),
> +			     .next_offset = sizeof(struct ipt_standard),
> +		     },
> +		     .target = {
> +			     .target = {
> +				     .u.target_size = IPT_ALIGN(sizeof(struct ipt_standard_target)),
> +			     },
> +			     .verdict = -NF_ACCEPT - 1,
> +		     },
> +	     },
> +	},
> +	/* ERROR */
> +	.term = { 
> +		.target = {
> +			.target = {
> +				.u.user = {
> +					.target_size = IPT_ALIGN(sizeof(struct ipt_error_target)), 
> +					.name = IPT_ERROR_TARGET,
> +				},
> +			},
> +			.errorname = "ERROR",
> +		},
> +	}
>  };
>  
>  static struct ipt_table packet_raw = { 
> 

           reply	other threads:[~2004-06-17 13:07 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20040616160921.2727a57c@dell_ss3.pdx.osdl.net>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40D1978C.3040406@trash.net \
    --to=kaber@trash.net \
    --cc=coreteam@netfilter.org \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=shemminger@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.