๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Tue, 20 Oct 2026 15:38
Re: [PATCH net 10/10] netfilter: nf_conntrack_netlink: fix inverted IPv6 tuple filter
#5570
Author: netdev-bot+sashiko
Date: Tue, 20 Oct 2026 15:38
52 lines
8393 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The first sentence of the commit message describes the pre-patch
  behaviour backwards.

--

netfilter: nf_conntrack_netlink: fix inverted IPv6 tuple filter

This commit drops the negation in front of ipv6_addr_cmp() in the IPv6
branch of ctnetlink_filter_match_tuple(). With that change, the
CTA_IP_SRC and CTA_IP_DST filters return 0 only when the addresses
differ, which matches the IPv4 path.

> ctnetlink_filter_match_tuple() returns 0 (no match) when the IPv6
> source or destination address differs from the filter, because the
> !ipv6_addr_cmp() test is inverted.

[Severity: Low]
Does this first sentence describe the pre-patch behaviour backwards?

ipv6_addr_cmp() is a memcmp() wrapper and returns 0 for equal addresses:

include/net/ipv6.h:ipv6_addr_cmp() {
	return memcmp(a1, a2, sizeof(struct in6_addr));
}

Before the patch, ctnetlink_filter_match_tuple() had:

	if ((flags & CTA_FILTER_FLAG(CTA_IP_SRC)) &&
	    !ipv6_addr_cmp(&filter_tuple->src.u3.in6,
			   &ct_tuple->src.u3.in6))
		return 0;

That code returned 0 when the addresses were equal. When they differed,
it fell through and the entry counted as a match. The quoted sentence
describes the behaviour after the fix, not the bug.

The next sentence ("the negation makes the branch trigger on a match
instead of a mismatch") does describe the bug correctly, so the
paragraph contradicts itself.

Could the first sentence be reworded to say that the function returned
0 when the IPv6 address matched the filter?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261019150249.1879516-2-pablo%40netfilter.org
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads