lib: fix setns() function when !HAVE_SETNS

When HAVE_SETNS is not set, iproute2 provides a local implementation of this
function based on __NR_setns.
This macro is defined in sys/syscall.h, which was not included, thus the local
implementation always returned -1.

CC: Vadim Kochan <vadim4j@gmail.com>
Fixes: eb67e4498a ("lib: Add netns_switch func for change network namespace")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
This commit is contained in:
Nicolas Dichtel 2015-01-15 11:36:25 +01:00 committed by Stephen Hemminger
parent ffff693130
commit 1ff6b16e2d
1 changed files with 1 additions and 0 deletions

View File

@ -3,6 +3,7 @@
#include <sched.h> #include <sched.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/syscall.h>
#include <errno.h> #include <errno.h>
#define NETNS_RUN_DIR "/var/run/netns" #define NETNS_RUN_DIR "/var/run/netns"