All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [iptables PATCH 6/8] xtables-restore: Drop pointless newargc reset
Date: Fri, 18 Oct 2019 10:30:56 +0200	[thread overview]
Message-ID: <20191018083056.6ovhjtl5eluwmqhh@salvia> (raw)
In-Reply-To: <20191017224836.8261-7-phil@nwl.cc>

On Fri, Oct 18, 2019 at 12:48:34AM +0200, Phil Sutter wrote:
> This was overlooked when merging argv-related code: newargc is
> initialized at declaration and reset in free_argv() again.
> 
> Fixes: a2ed880a19d08 ("xshared: Consolidate argv construction routines")
> Signed-off-by: Phil Sutter <phil@nwl.cc>
> ---
>  iptables/xtables-restore.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c
> index df8844208c273..bb6ee78933f7a 100644
> --- a/iptables/xtables-restore.c
> +++ b/iptables/xtables-restore.c
> @@ -232,9 +232,6 @@ void xtables_restore_parse(struct nft_handle *h,
>  			char *bcnt = NULL;
>  			char *parsestart = buffer;
>  
> -			/* reset the newargv */
> -			newargc = 0;

Are you sure this is correct? This resets the variable for each table
this is entering.

BTW, newargv, newargc are defined as globals which is very hard to
follow when reading this code. Probably place them in a structure
definition and pass them to functions to make easier to follow track
of this code?

That code would qualify for placing it under
iptables/xtables-restore.c since it is common for the xml and the
native parser as I suggested before.

  reply	other threads:[~2019-10-18  8:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17 22:48 [iptables PATCH 0/8] A bit of *tables-restore review fallout Phil Sutter
2019-10-17 22:48 ` [iptables PATCH 1/8] xtables-restore: Treat struct nft_xt_restore_parse as const Phil Sutter
2019-10-18  8:09   ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 2/8] xtables-restore: Use xt_params->program_name Phil Sutter
2019-10-18  8:09   ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 3/8] xtables-restore: Introduce rule counter tokenizer function Phil Sutter
2019-10-18  8:11   ` Pablo Neira Ayuso
2019-10-18  9:50     ` Phil Sutter
2019-10-18 10:03       ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 4/8] xtables-restore: Constify struct nft_xt_restore_cb Phil Sutter
2019-10-18  8:11   ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 5/8] iptables-restore: Constify struct iptables_restore_cb Phil Sutter
2019-10-18  8:12   ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 6/8] xtables-restore: Drop pointless newargc reset Phil Sutter
2019-10-18  8:30   ` Pablo Neira Ayuso [this message]
2019-10-18  9:54     ` Phil Sutter
2019-10-17 22:48 ` [iptables PATCH 7/8] xtables-restore: Drop local xtc_ops instance Phil Sutter
2019-10-18  8:31   ` Pablo Neira Ayuso
2019-10-17 22:48 ` [iptables PATCH 8/8] xtables-restore: Drop chain_list callback Phil Sutter
2019-10-18  8:32   ` Pablo Neira Ayuso

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=20191018083056.6ovhjtl5eluwmqhh@salvia \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=phil@nwl.cc \
    /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.