]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
lib: fix setns() function when !HAVE_SETNS
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 15 Jan 2015 10:36:25 +0000 (11:36 +0100)
committerStephen Hemminger <shemming@brocade.com>
Thu, 5 Feb 2015 18:11:51 +0000 (10:11 -0800)
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: eb67e4498aec ("lib: Add netns_switch func for change network namespace")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
include/namespace.h

index 28a4223b3eb2066beee681d6cd9cd1e8a6eb9619..52f7fbd7bb8c07db288dadc90a8235cbae396348 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <sched.h>
 #include <sys/mount.h>
+#include <sys/syscall.h>
 #include <errno.h>
 
 #define NETNS_RUN_DIR "/var/run/netns"