Re: [PATCH nf-next v4 2/3] netfilter: bridge: pass L2 header and VLAN as netlink attributes in queues to userspace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stephane Bryant <stephane.ml.bryant@xxxxxxxxx> wrote:
> From: stephane <stephane.ml.bryant@xxxxxxxxx>
> 
> -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!
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux