Skip to contentSkip to conversation

netfilter: nf_flow_table_ip: reset mac header before vlan push

PATCH In review Eric Woudstra 2 participants 2 messages Mar 10 – Mar 11

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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().

---

This patch replaces:

"netfilter: nf_flow_table_ip: Introduce nf_flow_vlan_push()"

 net/netfilter/nf_flow_table_ip.c | 1 +
 1 file changed, 1 insertion(+)
net/netfilter/nf_flow_table_ip.c +1 -0
index 3fdb10d9bf7f..fd56d663cb5b 100644
@@ -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;
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Eric Woudstra

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 c653d5a78f34 ("netfilter: flowtable: inline vlan encapsulation in xmit path")
Quoted 1 line
Quoted 24 lines

---

This patch replaces:

"netfilter: nf_flow_table_ip: Introduce nf_flow_vlan_push()"

 net/netfilter/nf_flow_table_ip.c | 1 +
 1 file changed, 1 insertion(+)
net/netfilter/nf_flow_table_ip.c +1 -0
index 3fdb10d9bf7f..fd56d663cb5b 100644
@@ -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;
Signature · 1 line
2.53.0