vppinfra: zero-terminate self netns path 02/43602/2
authorAlexander Maltsev <[email protected]>
Wed, 10 Sep 2025 13:57:03 +0000 (18:57 +0500)
committerDamjan Marion <[email protected]>
Mon, 15 Sep 2025 18:36:05 +0000 (18:36 +0000)
Fix tap_create_if sometimes failing to get current netns.

Type: fix
Change-Id: I30f7cd623028da52240d8d29077a01a59cb96f77
Signed-off-by: Alexander Maltsev <[email protected]>
src/vppinfra/linux/netns.c

index 2bd62bd..487be48 100644 (file)
@@ -27,7 +27,7 @@ clib_netns_open (u8 *netns_u8)
   int fd;
 
   if ((NULL) == netns)
-    s = format (0, "/proc/self/ns/net");
+    s = format (0, "/proc/self/ns/net%c", 0);
   else if (strncmp (netns, "pid:", 4) == 0)
     s = format (0, "/proc/%u/ns/net%c", atoi (netns + 4), 0);
   else if (netns[0] == '/')