Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa47e42c authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso
Browse files

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: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 73796d8b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;