All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfilter: flowtable: fix IPv6 tunnel addr match
@ 2021-11-07  1:28 Will Mortensen
  2021-11-08 10:55 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Will Mortensen @ 2021-11-07  1:28 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Will Mortensen, Pablo Neira Ayuso, wenxu

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 <pablo@netfilter.org>
Cc: wenxu <wenxu@ucloud.cn>
Signed-off-by: Will Mortensen <willmo@gmail.com>
---
 net/netfilter/nf_flow_table_offload.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nf_flow_table_offload.c b/net/netfilter/nf_flow_table_offload.c
index d6bf1b2cd541..b561e0a44a45 100644
--- a/net/netfilter/nf_flow_table_offload.c
+++ b/net/netfilter/nf_flow_table_offload.c
@@ -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;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netfilter: flowtable: fix IPv6 tunnel addr match
  2021-11-07  1:28 [PATCH] netfilter: flowtable: fix IPv6 tunnel addr match Will Mortensen
@ 2021-11-08 10:55 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2021-11-08 10:55 UTC (permalink / raw)
  To: Will Mortensen; +Cc: netfilter-devel, wenxu

On Sat, Nov 06, 2021 at 06:28:21PM -0700, Will Mortensen wrote:
> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-08 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-07  1:28 [PATCH] netfilter: flowtable: fix IPv6 tunnel addr match Will Mortensen
2021-11-08 10:55 ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.