Skip to contentSkip to conversation

netfilter: flowtable: incorrect pppoe tuple in reply direction

PATCH Superseded Pablo Neira Ayuso 1 participant 1 message Apr 10, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 netfilter: flowtable: incorrect pppoe tuple in reply direction

pppoe traffic coming in reply direction does not match the flowtable entry because the pppoe header is expected to be at the network header offset. This bug causes a mismatch in the flow table lookup, so pppoe packets in the reply direction enter the classical forwarding path in the flow table.

Fixes 72efd585f714 ("netfilter: flowtable: add pppoe support")
---
 net/netfilter/nf_flow_table_ip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_flow_table_ip.c +1 -1
index 9e9e105052da..5383bed3d3e0 100644
@@ -157,7 +157,7 @@ static void nf_flow_tuple_encap(struct sk_buff *skb,
 		tuple->encap[i].proto = skb->protocol;
 		break;
 	case htons(ETH_P_PPP_SES):
-		phdr = (struct pppoe_hdr *)skb_mac_header(skb);
+		phdr = (struct pppoe_hdr *)skb_network_header(skb);
 		tuple->encap[i].id = ntohs(phdr->sid);
 		tuple->encap[i].proto = skb->protocol;
 		break;
Signature · 1 line
2.30.2