Skip to contentSkip to conversation

netfilter: flowtable: fix IPv6 tunnel addr match

PATCH Applied Will Mortensen 2 participants 2 messages Nov 7, 2021 – Nov 8, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: flowtable: fix IPv6 tunnel addr match

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 Pablo Neira Ayuso <[email protected]>
---
 net/netfilter/nf_flow_table_offload.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_flow_table_offload.c +2 -2
index d6bf1b2cd541..b561e0a44a45 100644
@@ -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;
Signature · 1 line
2.30.2
maintainer Applied
#1 lore raw
Quoted 5 lines · Will Mortensen

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.

Applied.