]> Git Repo - J-linux.git/commitdiff
netfilter: flowtable: fix IPv6 tunnel addr match
authorWill Mortensen <[email protected]>
Sun, 7 Nov 2021 01:28:21 +0000 (18:28 -0700)
committerPablo Neira Ayuso <[email protected]>
Mon, 8 Nov 2021 11:14:05 +0000 (12:14 +0100)
Previously the IPv6 addresses in the key were clobbered and the mask was
left unset.

I haven't tested this; I noticed it while skimming the code to
understand an unrelated issue.

Fixes: cfab6dbd0ecf ("netfilter: flowtable: add tunnel match offload support")
Cc: wenxu <[email protected]>
Signed-off-by: Will Mortensen <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
net/netfilter/nf_flow_table_offload.c

index d6bf1b2cd541b7302bdb7284f954d91af386e7a1..b561e0a44a45f36392611d6ed4b94c34f920e29f 100644 (file)
@@ -65,11 +65,11 @@ static void nf_flow_rule_lwt_match(struct nf_flow_match *match,
                       sizeof(struct in6_addr));
                if (memcmp(&key->enc_ipv6.src, &in6addr_any,
                           sizeof(struct in6_addr)))
-                       memset(&key->enc_ipv6.src, 0xff,
+                       memset(&mask->enc_ipv6.src, 0xff,
                               sizeof(struct in6_addr));
                if (memcmp(&key->enc_ipv6.dst, &in6addr_any,
                           sizeof(struct in6_addr)))
-                       memset(&key->enc_ipv6.dst, 0xff,
+                       memset(&mask->enc_ipv6.dst, 0xff,
                               sizeof(struct in6_addr));
                enc_keys |= BIT(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS);
                key->enc_control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
This page took 0.047903 seconds and 4 git commands to generate.