From: Pablo Neira Ayuso Date: Tue, 15 Dec 2015 20:29:16 +0000 (+0100) Subject: netfilter: nf_tables: use skb->protocol instead of assuming ethernet header X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=aa47e42c60dfa31f81a3fe357451acfe1a12ca1e;p=linux-beck.git netfilter: nf_tables: use skb->protocol instead of assuming ethernet header Otherwise we may end up with incorrect network and transport header for other protocols. Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nf_tables_netdev.c b/net/netfilter/nf_tables_netdev.c index 7b9c053ba750..edb3502f2016 100644 --- a/net/netfilter/nf_tables_netdev.c +++ b/net/netfilter/nf_tables_netdev.c @@ -94,7 +94,7 @@ nft_do_chain_netdev(void *priv, struct sk_buff *skb, { struct nft_pktinfo pkt; - switch (eth_hdr(skb)->h_proto) { + switch (skb->protocol) { case htons(ETH_P_IP): nft_netdev_set_pktinfo_ipv4(&pkt, skb, state); break;