Skip to content

Commit 4889fbd

Browse files
skorpion17Paolo Abeni
authored andcommitted
seg6: bpf: fix skb checksum in bpf_push_seg6_encap()
Both helper functions bpf_lwt_seg6_action() and bpf_lwt_push_encap() use the bpf_push_seg6_encap() to encapsulate the packet in an IPv6 with Segment Routing Header (SRH) or insert an SRH between the IPv6 header and the payload. To achieve this result, such helper functions rely on bpf_push_seg6_encap() which, in turn, leverages seg6_do_srh_{encap,inline}() to perform the required operation (i.e. encap/inline). This patch removes the initialization of the IPv6 header payload length from bpf_push_seg6_encap(), as it is now handled properly by seg6_do_srh_{encap,inline}() to prevent corruption of the skb checksum. Fixes: fe94cc2 ("bpf: Add IPv6 Segment Routing helpers") Signed-off-by: Andrea Mayer <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent f048880 commit 4889fbd

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

net/core/filter.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6158,7 +6158,6 @@ static int bpf_push_seg6_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len
61586158
if (err)
61596159
return err;
61606160

6161-
ipv6_hdr(skb)->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
61626161
skb_set_transport_header(skb, sizeof(struct ipv6hdr));
61636162

61646163
return seg6_lookup_nexthop(skb, NULL, 0);

0 commit comments

Comments
 (0)