netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] nftables: ct: add byte/packet counter support
Date: Fri, 8 Jan 2016 13:43:49 +0100	[thread overview]
Message-ID: <20160108124349.GB26058@breakpoint.cc> (raw)
In-Reply-To: <20160108123818.GB4816@salvia>

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Thu, Jan 07, 2016 at 09:34:24PM +0100, Florian Westphal wrote:
> > @@ -366,6 +398,13 @@ static int nft_ct_get_dump(struct sk_buff *skb, const struct nft_expr *expr)
> >  		goto nla_put_failure;
> >  
> >  	switch (priv->key) {
> > +	case NFT_CT_BYTES:
> > +	case NFT_CT_PKTS:
> > +		if ((priv->dir == IP_CT_DIR_ORIGINAL ||
> > +		     priv->dir == IP_CT_DIR_REPLY) &&
> > +		     nla_put_u8(skb, NFTA_CT_DIRECTION, priv->dir))
> > +			goto nla_put_failure;
> > +		break;
> >  	case NFT_CT_PROTOCOL:
> 
> Any concern if I fold this change into your patch? It just simplifies
> this check, see below:
> 
>         switch (priv->key) {
>         case NFT_CT_BYTES:
>         case NFT_CT_PKTS:
> -               if ((priv->dir == IP_CT_DIR_ORIGINAL ||
> -                    priv->dir == IP_CT_DIR_REPLY) &&
> -                    nla_put_u8(skb, NFTA_CT_DIRECTION, priv->dir))
> +               if (priv->dir < IP_CT_DIR_MAX &&
> +                   nla_put_u8(skb, NFTA_CT_DIRECTION, priv->dir))
>                         goto nla_put_failure;

No, go ahead.

      reply	other threads:[~2016-01-08 12:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 20:34 [PATCH nf-next] nftables: ct: add byte/packet counter support Florian Westphal
2016-01-08  0:47 ` Florian Westphal
2016-01-08  1:33 ` Florian Westphal
2016-01-08  1:37   ` Florian Westphal
2016-01-08 12:38 ` Pablo Neira Ayuso
2016-01-08 12:43   ` Florian Westphal [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=20160108124349.GB26058@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).