]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netfilter: flowtable: use skb_pull_rcsum() to pop vlan/pppoe header
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 30 Apr 2026 19:55:01 +0000 (21:55 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 1 May 2026 10:39:23 +0000 (12:39 +0200)
This adjusts the checksum, if required, after pulling the layer 2
header, either the pppoe header or the inner vlan header in the
double-tagged vlan packets.

Fixes: 4cd91f7c290f ("netfilter: flowtable: add vlan support")
Fixes: 72efd585f714 ("netfilter: flowtable: add pppoe support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_flow_table_ip.c

index 2eba64eb393a2e8c405bc958009e16a8df2b973d..9c05a50d601384fc3ee499fba77ee6c75006a0c9 100644 (file)
@@ -445,13 +445,13 @@ static void nf_flow_encap_pop(struct nf_flowtable_ctx *ctx,
                switch (skb->protocol) {
                case htons(ETH_P_8021Q):
                        vlan_hdr = (struct vlan_hdr *)skb->data;
-                       __skb_pull(skb, VLAN_HLEN);
+                       skb_pull_rcsum(skb, VLAN_HLEN);
                        vlan_set_encap_proto(skb, vlan_hdr);
                        skb_reset_network_header(skb);
                        break;
                case htons(ETH_P_PPP_SES):
                        skb->protocol = __nf_flow_pppoe_proto(skb);
-                       skb_pull(skb, PPPOE_SES_HLEN);
+                       skb_pull_rcsum(skb, PPPOE_SES_HLEN);
                        skb_reset_network_header(skb);
                        break;
                }