From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Oester <kernel@linuxace.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] iptables: iptables-xml: Fix various parsing bugs
Date: Fri, 26 Jul 2013 16:52:21 +0200 [thread overview]
Message-ID: <20130726145221.GA28740@localhost> (raw)
In-Reply-To: <20130620125336.GA15704@gmail.com>
On Thu, Jun 20, 2013 at 08:53:36AM -0400, Phil Oester wrote:
> There are two bugs in iptables-xml do_rule_part parsing corrected by this patch:
>
> 1) Ignore "-A <chain>" instead of just "-A"
> 2) When checking to see if we need a <match> tag, inversion needs to be taken
> into account
>
> This closes netfilter bugzilla #679.
Applied with comestic change, thanks Phil.
> Phil
>
> Signed-off-by: Phil Oester <kernel@linuxace.com>
>
>
> diff --git a/iptables/iptables-xml.c b/iptables/iptables-xml.c
> index 4b12bd4..99d7527 100644
> --- a/iptables/iptables-xml.c
> +++ b/iptables/iptables-xml.c
> @@ -367,7 +367,8 @@ static void
> do_rule_part(char *leveltag1, char *leveltag2, int part, int argc,
> char *argv[], int argvattr[])
> {
> - int arg = 1; // ignore leading -A
> + int i;
> + int arg = 2; // ignore leading -A <chain>
> char invert_next = 0;
> char *spacer = ""; // space when needed to assemble arguments
> char *level1 = NULL;
> @@ -401,9 +402,14 @@ do_rule_part(char *leveltag1, char *leveltag2, int part, int argc,
>
> /* Before we start, if the first arg is -[^-] and not -m or -j or -g
> then start a dummy <match> tag for old style built-in matches.
> - We would do this in any case, but no need if it would be empty */
We prefer this comment style (similar to kernel coding style):
/* This is a long comment ...
* ...
*/
/* This is a short comment */
*Not your fault*, of course, that was already there, including some
trailing whitespace.
In general, I don't like patches to address comestic stuff only, I
think they generate too much noise, so I prefer that comestic stuff
gets fixed while fixing/enhancing some real thing, like in this case.
prev parent reply other threads:[~2013-07-26 14:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 12:53 [PATCH] iptables: iptables-xml: Fix various parsing bugs Phil Oester
2013-07-26 14:52 ` Pablo Neira Ayuso [this message]
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=20130726145221.GA28740@localhost \
--to=pablo@netfilter.org \
--cc=kernel@linuxace.com \
--cc=netfilter-devel@vger.kernel.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.