Thread (21 messages) flat view 21 messages, 4 authors, 3d ago

Re: [PATCH net-next 3/6] selftests: drv-net: psp: check the ifindex an associated netns sees

From: "Daniel Zahka" <daniel.zahka@gmail.com>
Date: 2026-09-14 12:11:32
Also in: linux-kselftest

On Sat Sep 12, 2026 at 4:04 PM EDT, Jakub Kicinski wrote:
quoted hunk ↗ jump to hunk
dev-get must not report the ifindex outside of the main netns.
The dev-get checks for an associated namespace are already there,
add the "no main ifindex" assertion.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 tools/testing/selftests/drivers/net/psp.py | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/tools/testing/selftests/drivers/net/psp.py b/tools/testing/selftests/drivers/net/psp.py
index 5e87fb50c348..43780efb84ed 100755
--- a/tools/testing/selftests/drivers/net/psp.py
+++ b/tools/testing/selftests/drivers/net/psp.py
@@ -749,6 +749,10 @@ from lib.py import ip
 
         ksft_not_none(peer_dev, "No PSP device found with by-association flag in guest netns")
 
+        # ifindex of the main netdevice means nothing in this namespace
+        ksft_true('ifindex' not in peer_dev,
+                  "ifindex reported to an associated namespace")
+
         # Verify assoc-list contains the nk_guest device
         ksft_true('assoc-list' in peer_dev and len(peer_dev['assoc-list']) > 0,
                   "Guest device should have assoc-list with local devices")
Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help