🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20674

Re: [PATCH net-next 1/2] selftests: net: enable receive metadata independently of its value

#20674
From: Hangbin Liu
Date: Mon, 23 Nov 2026 02:59
51 lines
10174 bytes
On Sun, Nov 22, 2026 at 03:49:11PM +0000, Jingjing Xu wrote:
> so_rcv_listener passes the expected mark or priority to setsockopt() as
> its SO_RCVMARK or SO_RCVPRIORITY enable flag. Consequently, expecting zero
> also disables the ancillary message being tested. A zero mark or priority
> is valid, but invoking the listener with -M 0 or -P 0 fails with ENOMSG.
> 
> Use a separate nonzero flag to enable reception and keep opt.val solely
> for checking the received value.
> 
> This issue was found with AI-assisted source review and reproduced using
> real UDP sockets. Zero and nonzero mark/priority tests pass over IPv4 and
> IPv6 after the fix; the zero cases fail on the original helper.
> 
> No kernel instrumentation or fault injection was used.
> 
> Fixes: c935af429ec2 ("selftests: net: add support for testing SO_RCVMARK and SO_RCVPRIORITY")
> Signed-off-by: Jingjing Xu <xujingjing@cmss.chinamobile.com>
> ---
>  tools/testing/selftests/net/so_rcv_listener.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/so_rcv_listener.c b/tools/testing/selftests/net/so_rcv_listener.c
> index bc5841192aa6..3d43fa688338 100644
> --- a/tools/testing/selftests/net/so_rcv_listener.c
> +++ b/tools/testing/selftests/net/so_rcv_listener.c
> @@ -65,6 +65,7 @@ static void parse_args(int argc, char *argv[])
>  
>  int main(int argc, char *argv[])
>  {
> +	int enable = 1;
>  	int err = 0;
>  	int recv_fd = -1;
>  	int ret_value = 0;
> @@ -88,7 +89,7 @@ int main(int argc, char *argv[])
>  		goto cleanup;
>  	}
>  
> -	err = setsockopt(recv_fd, SOL_SOCKET, opt.rcvname, &opt.val, sizeof(opt.val));
> +	err = setsockopt(recv_fd, SOL_SOCKET, opt.rcvname, &enable, sizeof(enable));
>  	if (err < 0) {
>  		perror("Recv setsockopt error");
>  		ret_value = -errno;
> base-commit: 2208ab00f4f213ade91ab775e7f8c4dacdcc856e
> -- 
> 2.53.0
> 
> 
> 

Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Technical Details
Message-ID: <20261123025906.GC10218@Liu-laptop>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368977-linux-kernel-netdev=dewy.ru
References: <20261122154912.1272447-1-xujingjing@cmss.chinamobile.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368977-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 1/2] selftests: net: enable receive metadata
 independently of its value
Date: Mon, 23 Nov 2026 10:59:06 +0800
Organization: Usenet Network
Message-ID: <20261123025906.GC10218@Liu-laptop>
References: <20261122154912.1272447-1-xujingjing@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="3776616"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/H9ClvQO68ZK5V3ufaVpc5kRB1E= sha256:Z/doU6H5MlIj0TQwGaQ/yK4mCZj09UR9DvcmOrKJGtk=
	sha1:N3Eh8gCg0r5iY78hjo2cWQgxCiQ= sha256:sOZzXZKMhBgPCictVBwQe3T5Scx2YGk9rXpN9QVtL1I=
Content-Disposition: inline
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 C223D125D8A; Mon, 23 Nov 2026 05:59:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
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 mJf7_A0s4ovu;
	Mon, 23 Nov 2026 05:59:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368977-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 38BEF125D87; Mon, 23 Nov 2026 05:59:27 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 4A0B429424; Mon, 23 Nov 2026 02:59:18 +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=1795402758;
	b=bzlmDOEGv/7PDk0a2kaTyQSoTxjB9aaanWVKe7l0UgZR2GyvymXl0SNuZwFUxVny/m+x
	 wTEtXyT2B1vgPFXaQU+EEdkpp8uuOPYBDbN1lvr9Niwoc+K8GRakfWXr5zsLLHWIMAUvk
	 ZFoKu9kly2Y5c4RwyuRnhEI4vHcPEbOJ7YbKnDOxzgdRVNfgrafHkZszHGoFh/6kHd0NL
	 fc3CztyQ+alzH58rL9uVXWb8a6NSsluEj29obsdw/fBFOohmvMS02KiDu8jY+VZwM5/VN
	 xjuVedv0bFl4GVHkDODfgtZsNRXfUBJDd55RmCrkOO8szEuDRGad9DU9xItJ2tiQn9w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795402758;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=Qwr2cCAOaet+9t0FDvm07EfNzCXFLHm+HRFJv2U38MA=;
	b=tlwpZK4NsWDQVysJrdo/ahhpO9wkgpOKQUPWdQCg6Z2WmCPJrXPMTGM/IqU5cEvBMO+U
	 6hTy9qai8lPxJ6cePgUTCQtr06Ju+tuLGhpMuDriYaAHElukPaWNWLr9c070jnNj2TstU
	 oDp7emaj9iI2/SwuyfJp+0pAPULpa6UtnJ+VFrGhlZnKEATUr3h5r9XtkdxOJV7/+VnMP
	 7xhYkFZQI97tVivWC0DXFxDISo1kiBncMM72Ih7o2ktwXAjUFWVELoIxresVPUyb8NEFj
	 sci/BZ4GP4YTQuc+jOOb7iwPoDd9Ei4Ndis4veohpOB1drYsPqG4xhMnbWB+eLajr/w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=uQKInNfR;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	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 20C2F606A32E;
	Mon, 23 Nov 2026 02:59:18 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=uQKInNfR
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.228
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795402757;
	b=iA+/eWHAK7SkD///IArdla6pTplm971Hxfdh7fnhogq63ztboYoGjzb+bGrHvc2NOmPP
	 FFtxeUVm6pKqfCFAluBr35sII3GAffZSehkUB2TRXmbFf9/2CH8QUz89NNMlQcSicNn5u
	 nxR6agTZtUORiMctyX/hrf2tiaCjINCs5VAmiuE6RRw3q3knAUt1hgkyJrAYYRbuMzTBe
	 FyY3GUBD1ILx0gUU0wvIHKDODUF8gSDmutUisx2tXGsT/1hUWBLWG9YfXj5Af+0gSzHHY
	 80OnHDAp/NRqzAyCoVLeePBDuGAF3kmVnWbTkknkFBQDmcdP27Upy/SR/t74+EULkWQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795402757;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=Qwr2cCAOaet+9t0FDvm07EfNzCXFLHm+HRFJv2U38MA=;
	b=UvIwVF5mjjBfaO1R1j+WYfIFiveZnPf+vh6asPF/GadRScC5PYe3+kNP+2kwqm1IA0fb
	 dHq+sEuSK67YSAwQuQ/bhm/Da0JAcQWvNfRXlp9OliKAoNhxosmb7C+Mbx9oq54nDol8J
	 XxHLmah2RBCUoEYL1QPbgF17/t/VVuFYm/oaXzh0beNDt+n/MCSV2wC1sZyh2LmMOsKs0
	 iV6hhosJxSRwtyP9CmI0ECmkXB0T/s5hP1tXFULdb1YclHRU9rjwGZ6vSrEE76bA3zre4
	 NwIIZVzA16U7byfbPVEv2XnuGN+Agbd4Qb462ZuJ1K5VL9HbB7XIrjgWzReem4/A8VQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=uQKInNfR;
	arc=none smtp.remote-ip=91.218.175.228
X-Received: from mta0.migadu.com (out-228.mta0.migadu.com [91.218.175.228])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id B802C606A31A
	for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 02:59:15 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B802C606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=Y2aqAhugKihjmhMcrLgqcMd8jYX+xFuHeB/bjurEUMk=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1795402753; v=1; x=1796007553;
 b=uQKInNfRF5slUUo8c7NrFfZSVd4WLR1FUo85S6eFa5obyJ7fb+vhKSiNb4tcCva27J2kaxMy
 IpJ4lD4ZGtc4fOTCqboheQPyudsgNocpHCR8Xed1DC7OvBOUMGLndxbZv/cwLnk3FPxEnvY3HAW
 NF2LCEYSpxfu9xRtVuoPJg8w=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta12.migadu.com with ESMTPS id dfd43cbaf89bbd57;
	Mon, 23 Nov 2026 02:59:13 +0000
X-Mizu-Trace-ID: dfd43cbaf89bbd57
X-Migadu-Flow: FLOW_OUT
X-Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	kuba@kernel.org, edumazet@kernel.org, pabeni@redhat.com,
	horms@kernel.org, shuah@kernel.org, willemb@google.com,
	annaemesenyiri@gmail.com, idosch@nvidia.com
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
X-In-Reply-To: <20261122154912.1272447-1-xujingjing@cmss.chinamobile.com>