mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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: 1fddf4bad0 ("netfilter: nf_log: add packet logging for netdev family")
Signed-off-by: Liping Zhang <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
This commit is contained in:
parent
b8ad652f97
commit
673ab46f34
4 changed files with 9 additions and 4 deletions
|
|
@ -24,7 +24,8 @@ static void nf_log_bridge_packet(struct net *net, u_int8_t pf,
|
|||
const struct nf_loginfo *loginfo,
|
||||
const char *prefix)
|
||||
{
|
||||
nf_log_l2packet(net, pf, hooknum, skb, in, out, loginfo, prefix);
|
||||
nf_log_l2packet(net, pf, eth_hdr(skb)->h_proto, hooknum, skb,
|
||||
in, out, loginfo, prefix);
|
||||
}
|
||||
|
||||
static struct nf_logger nf_bridge_logger __read_mostly = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue