Netdev List
 help / color / mirror / Atom feed
* [PATCH] netfilter: flowtable: update skb csum after pppoe header push
@ 2026-12-03  9:49 lvjunyu
  2026-12-03  9:59 ` netdev-bot+sinfo
  0 siblings, 1 reply; 2+ messages in thread
From: lvjunyu @ 2026-12-03  9:49 UTC (permalink / raw)
  To: pablo; +Cc: fw, phil, netfilter-devel, netdev, coreteam, lvjunyu

nf_flow_pppoe_push() pushes a new PPPoE session header in front of
the packet data but does not fold it into skb->csum.

For CHECKSUM_COMPLETE skbs the checksum covers everything from
skb->data onwards, so after __skb_push(PPPOE_SES_HLEN) the 8 bytes
of the new header are not accounted for in skb->csum.  Any later
consumer doing incremental checksum updates on top of skb->csum
then starts from a stale initial value and can drop valid packets.

This is inconsistent with the sibling paths, which all keep the
checksum in sync: the vlan push path uses skb_postpush_rcsum() and
the vlan/pppoe pop paths use skb_pull_rcsum().

Mirror the vlan push path and use skb_postpush_rcsum() so the
pushed header is accounted for in CHECKSUM_COMPLETE skbs.  Call it
after the header fields are written, since it folds in the bytes
as they are at call time.

Fixes: 18d27bed0880 ("netfilter: flowtable: inline pppoe encapsulation in xmit path")
Signed-off-by: lvjunyu <lvjunyu@cmss.chinamobile.com>
---
 net/netfilter/nf_flow_table_ip.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/netfilter/nf_flow_table_ip.c b/net/netfilter/nf_flow_table_ip.c
index 19cafae748ab..a0b541b811b4 100644
--- a/net/netfilter/nf_flow_table_ip.c
+++ b/net/netfilter/nf_flow_table_ip.c
@@ -585,6 +585,8 @@ static int nf_flow_pppoe_push(struct sk_buff *skb, u16 id,
 	ph->proto	= proto;
 	skb->protocol	= htons(ETH_P_PPP_SES);
 
+	skb_postpush_rcsum(skb, skb->data, PPPOE_SES_HLEN);
+
 	return 0;
 }
 
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-03  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  9:49 [PATCH] netfilter: flowtable: update skb csum after pppoe header push lvjunyu
2026-12-03  9:59 ` netdev-bot+sinfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox