netfilter: nf_log: do not assume ethernet header in netdev family
authorLiping Zhang <zlpnobody@gmail.com>
Mon, 14 Nov 2016 14:39:25 +0000 (22:39 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 4 Dec 2016 19:45:33 +0000 (20:45 +0100)
commit673ab46f345557e9d741e97ca0301280360d1af1
tree7274e919256ae409a0657306e823df780dff6282
parentb8ad652f9779976d0300ae199961e413859d5378
netfilter: nf_log: do not assume ethernet header in netdev family

In netdev family, we will handle non ethernet packets, so using
eth_hdr(skb)->h_proto is incorrect.

Meanwhile, we can use socket(AF_PACKET...) to sending packets, so
skb->protocol is not always set in bridge family.

Add an extra parameter into nf_log_l2packet to solve this issue.

Fixes: 1fddf4bad0ac ("netfilter: nf_log: add packet logging for netdev family")
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_log.h
net/bridge/netfilter/nf_log_bridge.c
net/netfilter/nf_log_common.c
net/netfilter/nf_log_netdev.c