๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5570

Re: [PATCH net 10/10] netfilter: nf_conntrack_netlink: fix inverted IPv6 tuple filter

#5570
From: 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
Technical Details
Message-ID: <179251071742.3135.9247422492065061476@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349374-linux-kernel-netdev=dewy.ru
References: <20261019150249.1879516-11-pablo@netfilter.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349374-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 10/10] netfilter: nf_conntrack_netlink: fix inverted
 IPv6 tuple filter
Date: Tue, 20 Oct 2026 15:38:37 +0000
Organization: Usenet Network
Message-ID: <179251071742.3135.9247422492065061476@kernel.org>
References: <20261019150249.1879516-11-pablo@netfilter.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3887515"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:iZvCggAP7la9YeQreeUJSmRjbNg= sha256:6DIS1EcTPMF0H61q1PD/VcWDNR2oTEtVd5OZ34RDLqA=
	sha1:/le/f+QEdpOQII8Q/MuwVe5Tl44= sha256:5CdNMEzEzVuEKWl23hG9Rqu5f8icteskNaWqoXSfsIs=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id C91D7110D63; Tue, 20 Oct 2026 18:47:09 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.299
X-Spam-Status: No, score=-3.299 tagged_above=-9999 required=6.31
	tests=[MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001]
	autolearn=ham autolearn_force=no
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id B4GZPnoEspuk;
	Tue, 20 Oct 2026 18:47:06 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-349374-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 9B17E110D60; Tue, 20 Oct 2026 18:47:03 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id D3B7D619994; Tue, 20 Oct 2026 15:39:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792510749;
	b=YwFgvLXlETLKh1GJm+++Dxx7pr2Bq2X8akdLXS3jR4JTnNkpjeb9i/LT5pIdTpFW0Qr6
	 pIpH7f1QG0m0JvGwpzSJv6bDc9sl4RlXOw14tjdi4gdHAm1V1Epk4rjWtUwYs7kVXw6Vs
	 B9wGYj9nLhlV5bbUJyF+T/rkZ/BievGOa9txdjSxHwC7lzZ41HcRy2fcwwm6MwRPAcJQL
	 NMpr1OhZZhC6OcxhCrb63cTXa4mD+PnwYzXZSPlFEij/1MWMmrXjjZoXM+tqysJ6iWvHR
	 eyv05lceGLJnv++benUqmYB+TIqDLyNwV0MLnTrL5H5nIR5S1HXYIoAnPFGweiQIW+A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792510749;
	h=X-Original-To:Received:Received:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version;
	bh=vL0uva0kDdgFyyEqNs7Zsoau2xkqgInZrttfe2t0o1A=;
	b=NQsmgKlBivvgLSy2C2BZ6ev5d60V8DiJheD8UT9Ig4JDWRB/yatvzFNB8zSQR/3C6GRs
	 YdM/+tb4TeiFAL1N16YuNor93oSQDS9H/gsgGv14O9Lwkm1GbAZxFtUrKSAVdvHQ18PZE
	 oTCo5db2pndW+85DXJPq/iPv1UslVZ5DZvvJWGKKbeIyI944Gp50qat/RTFpH967nVi5u
	 JDalVtPpHYGnPM2ab6CjUoBXAjO5pbki7UprvXRhsvCLAQ4Fg68heH2y5tLcIR/RdfQAS
	 2cNMAXf1P2d3ejvx2fpr8SsySgFyoUou/ILeStHK4f7ZGzESkr0/Pt8duD3T1lFc+2Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 84CA260A2606;
	Tue, 20 Oct 2026 15:39:09 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792510748;
	b=2VP49SRagZK1WXBfwTQZiYbZVSCnkcPFeusDJAQiiR4ORlfx8CwFHI9kLv3Y9OuegYft
	 MljWB5wvWvcfv2CZOhDUpRBYa53BALbizMFtifVlreL26emjHDssa3xceIhZy5jXrbsly
	 nxiBtIcBjoLCJFKEm4u51kASLK4Xv7qCMgees3uAu5pjE6cNpKf3BhpFOn/Nmpqp3Sc1V
	 B47o6AS5AN4mZtNjnS2ZAiMtDKlXE2pWyjIG3t7QH2gi1/Gh0CzWCA5HcRS8gqc8wwAq+
	 pXQbZhSg7CXQEujWVD1gVSv8LY/QGBwMWLdub1cbxbJOLAFx54eNH5BbouaV9yIjGuA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792510748;
	h=Received:Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References:
	 X-sashiko-severity:Content-Type:Content-Transfer-Encoding:
	 MIME-Version;
	bh=vL0uva0kDdgFyyEqNs7Zsoau2xkqgInZrttfe2t0o1A=;
	b=uHpgONGFNoFEwLYVo/Hndo7Oy9H6bYf6b+ku2t3NlRPQqmF9eOLQXnJntUa3rA3Owj4/
	 s6j/g7ru5bvyBOZIJTjGuNueRU2VZMvA3NAmySP/qxKCUFlgkpRdJMXZ200LpbkJJ+mkE
	 Zr2oe1Ly1A0erDeItRmz/UGMrVT+7+QsC/fWqB/zOsKIexslmKK1bSe3z7x5kXiBzpzID
	 YXomSBIQgy5BxSErXnm84fDmwCoyzMkkUHfpkV+NCxhyapQEMCKtJpMx4wXlAZANtmq0Q
	 Ir9Dt0OcjBnzC7ZeUNAQrCjUQ4KNcXAo/DEsGq7Ms8laFWIvMPf80F+ckIEvH19zE4A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id A86FD606A32A;
	Tue, 20 Oct 2026 15:39:08 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C59821F000CD;
	Tue, 20 Oct 2026 15:39:07 +0000 (UTC)
X-Cc: netfilter-devel@vger.kernel.org, davem@davemloft.net,
 netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com,
 edumazet@kernel.org, horms@kernel.org, fw@strlen.de, ja@ssi.bg
X-In-Reply-To: <20261019150249.1879516-11-pablo@netfilter.org>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list