mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
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 <pablo@netfilter.org>
This commit is contained in:
parent
73796d8bf2
commit
aa47e42c60
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue