Commit a3aca98a authored by Eric Woudstra's avatar Eric Woudstra Committed by Florian Westphal
Browse files

netfilter: nf_flow_table_ip: reset mac header before vlan push



With double vlan tagged packets in the fastpath, getting the error:

skb_vlan_push got skb with skb->data not at mac header (offset 18)

Call skb_reset_mac_header() before calling skb_vlan_push().

Fixes: c653d5a7 ("netfilter: flowtable: inline vlan encapsulation in xmit path")
Signed-off-by: default avatarEric Woudstra <ericwouds@gmail.com>
Acked-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
parent 598adea7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -738,6 +738,7 @@ static int nf_flow_encap_push(struct sk_buff *skb,
		switch (tuple->encap[i].proto) {
		case htons(ETH_P_8021Q):
		case htons(ETH_P_8021AD):
			skb_reset_mac_header(skb);
			if (skb_vlan_push(skb, tuple->encap[i].proto,
					  tuple->encap[i].id) < 0)
				return -1;