- clib_open_netns() expects a NULL-terminated C-string
- if no netns was given, we should not try to format it otherwise we'll
get "(nil)" as netns name.
Type: fix
Change-Id: I7b6022f6e8999640d0d2a83b854455b15fa4c134
Signed-off-by: Benoît Ganne <bganne@cisco.com>
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)