From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id D534480619 for ; Thu, 24 Sep 2026 11:07:56 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68OB6YTY014351; Thu, 24 Sep 2026 14:06:34 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68OB6YTY014351 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="fmV08ye/" Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 68OB6LpP014312 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 24 Sep 2026 14:06:21 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 68OB6LpP014312 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-4870ee5618aso1282965f8f.1 for ; Thu, 24 Sep 2026 04:06:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AKwUvBzZb/IvNWK4YrqZKQrXdr/TNrAFxjYUwceFXSC4pE1Lyv8kwD1ikVsi/C6HjbimSExR9v9REg==@openvz.org X-Gm-Message-State: AFuF++ly98R+ZYM2jV7ZVUWwdrCry2sRoCm0nH6q3+ot1NWdRJWgM8XG anBRe4vWkBCyNKE68CuBDCJA28xmpuYna4jRkcunymidlI4I6Dyj94NN/3ta/CbM4E2wG4V9VOp eXSgU1RUbQuytaFMyn8Id8QUZsQ++lHpIhEZYcpNqsg/8RIxtqobpAw== X-Gm-Gg: AYBFou39Rq92HaydBBL8t6Q0IrziAWEbVjppL+48drdAj/X2HU4qsNZ9KMxo4s7Yxt7 zbgBAXCxTGjGHrdYifkGwuJ4OLUK4TYfqbMDLVnU915y3tOb0h9nG0tRgULeD2gdh5BtnB+j7w+ PL+eeTypsQSrCuYBH6g/g8FtaLZ/qI1LsUajmi0bRk/6X7y2gv8fJV+EBNTmUsEhsBkcjcNzY5i iqHxyNDKOwUOLjATapp6kl8IL30fZQCUiZgqFA8BHFhP+yOPRY7Gj+W2K3fpyzpqDXjOUqdi+eY fOHEXYvA/zgb2eWjYV2myBf5tILXjTYEYDKiL26f0Uqf8vSNiXfGrXwlJPRo55b5iDDFgLGpqgJ /Fg5KIVM3YAnvCjGu X-Received: by 2002:a05:6000:250d:b0:485:ac52:e07f with SMTP id ffacd0b85a97d-48871680273mr3410267f8f.18.1790247981388; Thu, 24 Sep 2026 04:06:21 -0700 (PDT) X-Received: by 2002:a05:6000:250d:b0:485:ac52:e07f with SMTP id ffacd0b85a97d-48871680273mr3410213f8f.18.1790247980840; Thu, 24 Sep 2026 04:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790247980; cv=none; d=google.com; s=arc-20260327; b=ee4N2mwWkHjUGk3txRdVI7SanC/bOquwIcWHQTYZJYNvmvJevtLAwf2lRHLumMY5yk X56MLCKPA2LQNva9+NIDdKCafff7fpY+wTwteHhxzKyfZvecUB9vSZNOnaI5oU6tC8My tRLCZRrUTj+P5zOzs7dEIJ1xdUhxIeytrFn1zR/fyU2LaAKNNI0Q0z5vEoQkS40tjoKn 8FSIgD9ZwbsEFVuHiXs6J4CSOdifPC+iQr4rfFV+LMWUjPWWP/FoVxkiKtXkDdntYqpZ QLui6Sa7BzfhUKf5Nj3RN0X42R3/L7VpJvtXQcviM7Jh88ImGiZj9yV8s+6PDkGLIKQ6 wMSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=7KcyLUtOpa6f49m4ot8dPCc6gVhMoBP/Xzku2cwFg5g=; fh=Ac4B+E9J0iKprNz57k5baX4D1nACtq3mk5EYYPOTKpA=; b=bCt2RK3snDVuGH9bjS/bydFwU0NGczEnd3talorcLpb+dnEZV8I1o8f8u4BLpkm/35 zEHO6i09XMMlkjNODzVDJf4u5ZYWjJvPOJaPOwkzD1yS+hXVlODtqtprBBP9PiSWmbzJ Atxohr6aulx2xAuUuqBB17MhCTQADueL3+D3OKc38oXLeILGBJ2WOkmqt1AlTTz5CX+i kvblJWOoDFNoqEy3qYm8qReR8x6IrIOjDlfydMuR2mv5tX8KM+8UwogqXpvzs147UyXh a2/SQjYrEvu3XUEgXgKSTCk7hA7Af36whb9T9WaXDgxElBTrots6FpHECPRwJUT3IIdc xeGg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="fmV08ye/"; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-488688e775csi9556069f8f.428.2026.09.24.04.06.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2026 04:06:20 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="fmV08ye/"; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Content-Type:MIME-Version:Subject:Date :From; bh=7KcyLUtOpa6f49m4ot8dPCc6gVhMoBP/Xzku2cwFg5g=; b=fmV08ye/AAsmOcQ0IHz HiS9G5e16PwbM7gjSFT90sWzOfd2QClnrHC0H5wLhArv0Tbpdt8+1WQuaDN5+p/nQjYYlhyD1+0NM gN6n3i/InYcUsxrX3rX7tlEdt5zTWzjHUQ54Z2qspwUWXtwlOuFbpLaFsNf/EFhdD0qBxEtcMKOSE 7FvV3Mm8V9G/bJ4PbHgiFX1DcdmdThZ1aZ4YchniS6e2vRyxWVqyrEcYqHs9S4dadQCCbxnODjj0/ WSI/fgx4EIlpvqGW/sOiecuEvsoFj0RvhUmFM15q38/4zd5hc69eHWlj3aDbvcASg0yXpMp1NeYU2 UqW/Agc2Cfgupww==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x9hEU-00CbHw-0P; Thu, 24 Sep 2026 13:06:18 +0200 From: Konstantin Khorenko Date: Thu, 24 Sep 2026 13:06:08 +0200 MIME-Version: 1.0 Message-Id: <20260924-b4-prep-netfilter-v3-3-e6a17b8f193f@virtuozzo.com> References: <20260924-b4-prep-netfilter-v3-0-e6a17b8f193f@virtuozzo.com> In-Reply-To: <20260924-b4-prep-netfilter-v3-0-e6a17b8f193f@virtuozzo.com> To: Konstantin Khorenko , devel@openvz.org X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3261; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=72UTHFA9p48iFANnkkxiVayVm1HznyWqU3uBQ5O9Ugg=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqtQQqrDrGbiW0+wnSiuhnqA9GcBoSeM/jAJ6us yiB2fBtUvSJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCarUEKgAKCRBRlgpH+WFc KjWSD/4iEF2jcnXz5M9AejRcDVM7fISA1LA8b6TLti4laL3yj4i8p4ambpYfHOpVuWpOGi0sBK3 jvqxAT5baWl3VVaZyJ1Fb3+m26/WLmQxMfR1jZT7+DhhqR0GR+Ob6hNEANVykM5UQy6q31b18FR 6gzOaN28QJhk1KCWlw+ulPDmK8fiK7nzEv71U5SpZaBEbBH+E+BTtvFFLMRrCinrByRW15IfUC+ Idlc+ooyd/DzCnd82RCZ4hhJd7fVbDs7h0o4QXZ1A6jzq/Wbr8VJcn8pyxd736ai2qstpiwOoOi 9GUjglioNO0HA7sICeAH5YPnPJY4wdlMmMKcC0WH/8sbLiicKcM38p6GwqST3BFrYKV9Q92mERY i9DLIkiQcGMl0Dp4eHxPlpwxewGt3UzBPYiAQFut38E1TazceyNdMUDpp/zJVeOJzkRgM4a8kOz ogV6er6SNqpiGqEltPHB/n1peRLazLLc5HRIl2U2nqU4dhuGdFRix5EOY96tpq74emgAbJgx1fT HWNK69iNoLDVFB4mN/nWoETFFM5MDhcE/SaOpNsItSC7X21h23lKvOr1HDY4ru7AsQ0zsrJ2QQz GpuSzhefEf0MgiLV79uysXJzVGIcL/C5hjbKTdWWQT4GzT3+bq9t+7WKTfWRxbBDcU71CMsZTtR sNiuSuYY8g6l2tA== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Subject: [Devel] [PATCH hci-8.1 v3 3/5] selftests: netfilter: add the veth pair from inside the namespace X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org From: Eva Kurchatova Both tests add a veth by name while running in the initial namespace. The name of the new device is taken there, not in the namespace passed to netns, so a device of that name left behind by another test makes the add fail and the test then runs with no connectivity at all: # RTNETLINK answers: File exists # Cannot find device "veth1" # FAIL: socat cannot connect via NAT'd address Add the pair from inside one of the namespaces instead. Those are made by setup_ns and are empty, and the peer is created directly in its own namespace, so no name from the initial namespace is in the way. br_netfilter.sh checked only the first of its four adds, so a failure of any of the others was silent and turned up much later as a ping to a namespace that had no interface. Check all four. https://virtuozzo.atlassian.net/browse/VSTOR-139651 Feature: fix selftests Signed-off-by: Eva Kurchatova Reviewed-by: Konstantin Khorenko --- v3: one-line comments instead of a retelling of this message; drop the line count from the text. --- tools/testing/selftests/net/netfilter/br_netfilter.sh | 17 +++++++++-------- tools/testing/selftests/net/netfilter/nf_nat_edemux.sh | 9 +++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/net/netfilter/br_netfilter.sh b/tools/testing/selftests/net/netfilter/br_netfilter.sh index 011de87630940..8648f07871090 100755 --- a/tools/testing/selftests/net/netfilter/br_netfilter.sh +++ b/tools/testing/selftests/net/netfilter/br_netfilter.sh @@ -60,14 +60,15 @@ bcast_ping() done } -if ! ip link add veth1 netns "$ns0" type veth peer name eth0 netns "$ns1"; then - echo "SKIP: Can't create veth device" - exit $ksft_skip -fi - -ip link add veth2 netns "$ns0" type veth peer name eth0 netns "$ns2" -ip link add veth3 netns "$ns0" type veth peer name eth0 netns "$ns3" -ip link add veth4 netns "$ns0" type veth peer name eth0 netns "$ns4" +# add from inside the netns so a stale vethN in init_net cannot get in the way +for i in $(seq 1 4); do + nsvar="ns$i" + if ! ip -net "$ns0" link add "veth$i" type veth \ + peer name eth0 netns "${!nsvar}"; then + echo "SKIP: Can't create veth device" + exit $ksft_skip + fi +done for i in $(seq 1 4); do ip -net "$ns0" link set "veth$i" up diff --git a/tools/testing/selftests/net/netfilter/nf_nat_edemux.sh b/tools/testing/selftests/net/netfilter/nf_nat_edemux.sh index 1014551dd7694..0ddea0f79e55c 100755 --- a/tools/testing/selftests/net/netfilter/nf_nat_edemux.sh +++ b/tools/testing/selftests/net/netfilter/nf_nat_edemux.sh @@ -22,10 +22,11 @@ trap cleanup EXIT setup_ns ns1 ns2 -# Connect the namespaces using a veth pair -ip link add name veth2 type veth peer name veth1 -ip link set netns "$ns1" dev veth1 -ip link set netns "$ns2" dev veth2 +# add from inside the netns so a stale veth1 in init_net cannot get in the way +if ! ip -net "$ns1" link add name veth1 type veth peer name veth2 netns "$ns2"; then + echo "SKIP: Can't create veth device" + exit $ksft_skip +fi ip netns exec "$ns1" ip link set up dev lo ip netns exec "$ns1" ip link set up dev veth1 -- 2.43.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel