Skip to content

Commit

Permalink
netfilter: nf_tables: use skb->protocol instead of assuming ethernet …
Browse files Browse the repository at this point in the history
…header

Otherwise we may end up with incorrect network and transport header for
other protocols.

Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
ummakynes committed Dec 18, 2015
1 parent 73796d8 commit aa47e42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_tables_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aa47e42

Please sign in to comment.