From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796060954; b=rokBqeoXC09GAtWqDlZrGID7UVuSbI8+PT4q4ZqC6fy7CpvD6Li2UxdMyZ374tHPEAVA ls6npGBj20ygKPSYUqwsT60LKgX9G6WvffLCZn+SQ2mH0ugWzA4CtojDoHFl6bvIdA0oY bIH1tlo9y6IjqS2vahgxC/vCccs/ZhOToHFfIQ/bWi0vTuMHFuwndIL47ImA4Vvz5Bdjv gna/cDQV49WU/utCHOdTEkYVP+qaMptHQmGOW8c4u12Qz1s41IcWoPWTpfIPCuPJ4WSVk IHaRVY4fe3rxjonFOn4hvoBnBH0DtSwMZ5hDcEyWYUYpcIIr1sYi6DZYmNHU4XxZ/GQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796060954; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Message-ID:Date:MIME-Version:User-Agent:Subject: To:Cc:References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=BEoR/6Y6OeFkXN5ZTVIhs2KF72da5fI0qduF8eZU5eM=; b=rrKcKiMvPvIeZGnFn8ic6MOKj544qiX1jobcVJz98YiiRQNU0oKmOqPTWatIoqCUNdwo z7x4j+4xNpbjveqIiAGXIzgRgxV8SvpJGCWciRg1WUrauGPYj8PmCOYK8lhHEJ9LYeW5D ufjs8NBIMKjNXrEiu77RZG7JPRg0zJxLn4WwIxtz2EeEkiF69FnqiBSN7RS5FgH5O1eWw Gn9KxSj6jWGHLXl0QziUx8rYsJDhlM3BGUp2L8ldtAoVs6QEZVsF3i0rYPGhb93whS9fe 1oSBOCutxQInVFdloNxWOKytC1/GYJQ9w0UxxB6S6HDxPRCYgnIps70kbZDXpiIDHIw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VKLzNFgc; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=SD1atOW3; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80D19606A31C for ; Mon, 30 Nov 2026 17:49:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 80D19606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VKLzNFgc; dkim=pass (2048-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=SD1atOW3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796060952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BEoR/6Y6OeFkXN5ZTVIhs2KF72da5fI0qduF8eZU5eM=; b=VKLzNFgcEF3RYRSON6eV2wBCOOUHbSj88VeOE/8uAIfb0coVRR3r8Vvp3gLbMFawDdDA7z 3J6dMz4/x+6mT47j0W7zCN/+PtS4pPeZCcEAJtdZxnMv7hVNeBiyQTp3Hk1P8F9FtydquA X2HKhM5AGi5ALLjPj3FnzzhWlnJlPPU= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-531-DUaombOCMn-hThaYWZqtwg-1; Mon, 30 Nov 2026 17:49:10 +0000 X-MC-Unique: DUaombOCMn-hThaYWZqtwg-1 X-Mimecast-MFC-AGG-ID: DUaombOCMn-hThaYWZqtwg_1796060949 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-4bbc86e1eb0so4293668f8f.0 for ; Mon, 30 Nov 2026 09:49:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796060949; x=1796665749; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=BEoR/6Y6OeFkXN5ZTVIhs2KF72da5fI0qduF8eZU5eM=; b=SD1atOW3o0lA4npLOxwjmSbwnPiugf4awOhtIIF/al0vFWMeVmFH+yCAfSg/DGMwQW L7k18FsIKvZx+P6pND86jr8C6CGAT6BkMSrMp+85UJan98cZg9mXaq9GafkNGtZjbOhE HwE2NsmX4MzgjfRmadG/+QVB44rqZPEUuhsh0v9fdAW3s45ECV7dsCaptElqqCDzlcvT +e+0jyRpIVqPR3rlmOZ4guyUriBETBw7zNzRy01G9e3DoLvf9svpPNyb+GMvsIRQEqjv jJ6QBwC0RgxNtFIVoBX1huYZxPRJisSLlgAs2xmNcRej6F8GHr56LslXKcyEQpU1itHn WOCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796060949; x=1796665749; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=BEoR/6Y6OeFkXN5ZTVIhs2KF72da5fI0qduF8eZU5eM=; b=D282chGCTn+U1EtYiAgGki3/IqbAkw4Vtbbagaui7kwqTYBeYqcJE/vMfIlW4MSvks BneaYWF2m0zrm0vM/bK9dC4Tx+F1ry/v3DLui8ML9QFbSSrf+5pdlmebrq5f3MryjT+H dABOr4gtpJ1U4lD/0TPRjr84F0omKgpdjuq4XFDOGO0UlnAuFLN2OYRJY+2OXjUb1/+Q +qQR5+SV4JYDUwa4kGe3d1JaWcqduq78KzxgoPcWgvhYPDPRMTPsDula9AIKT7QwvoGh QnOqjYHLQrvOL2zKWcuaY1XnknXfpdJTNFN4ZUVJrrLY2wKXGfLN4FsQcESSsboh3osM ao/g== X-Forwarded-Encrypted: i=1; AL+hErH16SW8saHSKwfQld3rluzqVull1j6owX9DGUauGLA1tvh+qjqvT3OWcKpvzu/7nBQx9OihYvA=@vger.kernel.org X-Gm-Message-State: APuU4Z9CVAAU1etWCZw/Rj1G95g7gsEpeAjjip6ZEcieaDnzvCTjP3+U 0f1yEAWE/GRxo0IqFXp/6DCKzXUHFjxNdoRS5Lxxl3c47HKhZSfQd4pkkOI2Q6PpLt/4S8Doblm K7Zz51gBlbRrzER1JoBwWQ60YRt4tkU5DszfbpWcTefq0AeftJsV9dB4ZSw== X-Gm-Gg: AZFdTZdM7Xf7sRFcm7bVFYwU2dTaFfbW7oqD5gn1ny/YcjSIoUXRaFUI2GXFKZt1qV0 bOKDmqVPaL7IwsUJ7cmkydu5cZQTr9KRTKC2AqlTXXp/V/JGaYMbh3fL6/R3h2qePNVrjO0+FEu satkPJ8mSAA0o5xarAPw3FWF3oa0eWy3QSF4pXllHGeSuRqEUV4HcSde7D/TDhaEsrUyvSzEBbF OD88fuLYG/azl16uzEtd9ScKo+4Kxn0mOmfFI4YxVNjOSFZ/rUdRXlPhRlThEo+igJ6LpBpqr61 EL6f2oz+cnawOtOAOk3ScHCIAtKNceXC3DlHU2v+BkbKTGolLtYB8a4KR5fvs8n+By7LCXXzPZL Mhjk27Nj3MirD1sHTvWQw5pR21kJnnvm7SGAOYr3cRLiwNyY/Pd+5Y3G0/OHZ4WFatmKEHNPTZe hTTOwjkwXPL/aBit3mWRG5ZBvfieQR9zc5Al3jiLlRdgcL X-Received: by 2002:a5d:5846:0:b0:4b5:fdc3:33ca with SMTP id ffacd0b85a97d-4b5fdc33455mr46386391f8f.32.1796060948901; Mon, 30 Nov 2026 09:49:08 -0800 (PST) X-Received: by 2002:a5d:5846:0:b0:4b5:fdc3:33ca with SMTP id ffacd0b85a97d-4b5fdc33455mr46386342f8f.32.1796060948290; Mon, 30 Nov 2026 09:49:08 -0800 (PST) Received: from [192.168.88.30] (ip231-128-192-82.pool-bba.aruba.it. [82.192.128.231]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6a67fe75sm75679732f8f.24.2026.11.30.09.49.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 09:49:07 -0800 (PST) Message-ID: <2fed80ad-9a3c-412f-ac4d-45ec8892133e@redhat.com> Date: Mon, 30 Nov 2026 18:49:06 +0100 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next] selftests: net: match the local port in wait_port_listen To: Jingjing Xu , netdev@vger.kernel.org Cc: linux-kselftest@vger.kernel.org, kuba@kernel.org, edumazet@kernel.org, horms@kernel.org, shuah@kernel.org, willemb@google.com References: <20261122154923.1272551-1-xujingjing@cmss.chinamobile.com> Content-Language: en-US From: Paolo Abeni In-Reply-To: <20261122154923.1272551-1-xujingjing@cmss.chinamobile.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/22/26 16:49, Jingjing Xu wrote: > wait_port_listen() searches anywhere in each /proc/net/{tcp,udp}* row. > For UDP, a connected client whose remote port matches the requested port > therefore makes the helper return even if no local receiver is bound. > Callers waiting for a UDP server can consequently continue too early. > > Anchor the pattern to the start of the row and consume the slot and local > address before matching the port. Consume the remote address before the > TCP state, and terminate the LISTEN state match at a word boundary. > Keep accepting locally bound connected UDP sockets. > > For example, in an isolated network namespace with loopback up, run this > from tools/testing/selftests/net, with port 12345 unused locally: > > import socket > from lib.py import wait_port_listen > s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > s.connect(("127.0.0.1", 12345)) > wait_port_listen(12345, proto="udp", deadline=0.1) > > The original helper returns; the fixed helper times out as expected. > AI-assisted review found this issue. Real IPv4/IPv6 socket tests covered > absent, remote-only, bound and connected UDP ports, and absent, bound, > established and listening TCP sockets: the original failed two of 16 > cases, and the fixed helper passed all 16. No hardware tests were run. > > No kernel instrumentation or fault injection was used. > > Fixes: 31611cea8f0f ("selftests: drv-net: add a TCP ping test case (and useful helpers)") > Signed-off-by: Jingjing Xu Can the unmodified self-tests really hit this condition? If so, repost updating the changelog accordingly. Otherwise do not resubmit. /P