netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Stephane Bryant <stephane.ml.bryant@gmail.com>
Cc: pablo@netfilter.org, netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next v4 2/3] netfilter: bridge: pass L2 header and VLAN as netlink attributes in queues to userspace
Date: Fri, 18 Mar 2016 19:22:24 +0100	[thread overview]
Message-ID: <20160318182224.GB21628@breakpoint.cc> (raw)
In-Reply-To: <1458322416-4137-2-git-send-email-stephane.ml.bryant@gmail.com>

Stephane Bryant <stephane.ml.bryant@gmail.com> wrote:
> From: stephane <stephane.ml.bryant@gmail.com>
> 
> -this creates 2 netlink attribute NLQA_VLAN and NLQA_L2HDR
> -these are filled up for the PF_BRIDGE family on the way to userspace
> -NFQA_VLAN is a nested attribute, with the NFQA_VLAN_PROTO and the
>  NFQA_VLAN_TCI carrying the corresponding vlan_proto and vlan_tci
>  fields from the skb.
> 
> +	if ((entry->state.pf != PF_BRIDGE) || (!skb_mac_header_was_set(entskb)))
> +		return 0;

Nit: Inner () are not needed.

> +	if (skb_vlan_tag_present(entskb)) {
> +		nlalen += nla_total_size(nla_total_size(sizeof(__u16)) +
> +					 nla_total_size(sizeof(__be16)));
> +	}

Nit: {} not needed.

> +		if (nla_put_u16(skb, NFQA_VLAN_TCI, entskb->vlan_tci))
> +			goto nla_put_failure;

I would suggest to use nla_put_be16 + htons here, we also use bigendian
for things like skb->mark.

Rest looks good to me, thanks!

  reply	other threads:[~2016-03-18 18:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 17:33 [PATCH nf-next v4 1/3] netfilter: bridge: add nf_afinfo to enable queuing to userspace Stephane Bryant
2016-03-18 17:33 ` [PATCH nf-next v4 2/3] netfilter: bridge: pass L2 header and VLAN as netlink attributes in queues " Stephane Bryant
2016-03-18 18:22   ` Florian Westphal [this message]
2016-03-18 17:33 ` [PATCH nf-next v4 3/3] netfilter: bridge: nf queue verdict to use NFQA_VLAN and NFQA_L2HDR Stephane Bryant

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=20160318182224.GB21628@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=stephane.ml.bryant@gmail.com \
    /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).