]> Git Repo - linux.git/commitdiff
bpf: allow disabling tunnel csum for ipv6
authorWilliam Tu <[email protected]>
Fri, 1 Dec 2017 23:26:09 +0000 (15:26 -0800)
committerDavid S. Miller <[email protected]>
Mon, 4 Dec 2017 16:04:19 +0000 (11:04 -0500)
Before the patch, BPF_F_ZERO_CSUM_TX can be used only for ipv4 tunnel.
With introduction of ip6gretap collect_md mode, the flag should be also
supported for ipv6.

Signed-off-by: William Tu <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/core/filter.c

index 6a85e67fafce224b534dd87bb9407ae115f8ba7a..8ec5a504eb28c50f616cbc931a2d3bcbb9a76cdf 100644 (file)
@@ -3026,10 +3026,11 @@ BPF_CALL_4(bpf_skb_set_tunnel_key, struct sk_buff *, skb,
                                  IPV6_FLOWLABEL_MASK;
        } else {
                info->key.u.ipv4.dst = cpu_to_be32(from->remote_ipv4);
-               if (flags & BPF_F_ZERO_CSUM_TX)
-                       info->key.tun_flags &= ~TUNNEL_CSUM;
        }
 
+       if (flags & BPF_F_ZERO_CSUM_TX)
+               info->key.tun_flags &= ~TUNNEL_CSUM;
+
        return 0;
 }
 
This page took 0.073078 seconds and 4 git commands to generate.