aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/af_xdp/device.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/af_xdp/device.c b/src/plugins/af_xdp/device.c
index 06b86893646..570f34cdc7e 100644
--- a/src/plugins/af_xdp/device.c
+++ b/src/plugins/af_xdp/device.c
@@ -637,7 +637,8 @@ af_xdp_create_if (vlib_main_t * vm, af_xdp_create_if_args_t * args)
ad->linux_ifname = (char *) format (0, "%s", args->linux_ifname);
vec_validate (ad->linux_ifname, IFNAMSIZ - 1); /* libbpf expects ifname to be at least IFNAMSIZ */
- ad->netns = (char *) format (0, "%s", args->netns);
+ if (args->netns)
+ ad->netns = (char *) format (0, "%s%c", args->netns, 0);
ad->linux_ifindex = if_nametoindex (ad->linux_ifname);
if (!ad->linux_ifindex)