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 <lvju…@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