Make it compile w/o libnl3
authorRobert Swiecki <swiecki@google.com>
Tue, 18 Oct 2016 11:54:27 +0000 (13:54 +0200)
committerRobert Swiecki <swiecki@google.com>
Tue, 18 Oct 2016 11:54:27 +0000 (13:54 +0200)
net.c

diff --git a/net.c b/net.c
index cddca0f41f91d86fb569db97100594bee3daed2a..ce29f734670b37ae2fdcde8a3b95098e7b10444f 100644 (file)
--- a/net.c
+++ b/net.c
@@ -115,15 +115,8 @@ bool netInitNsFromParent(struct nsjconf_t *nsjconf, int pid)
        return true;
 }
 #else                          // defined(NSJAIL_NL3_WITH_MACVLAN)
-static bool netSystemSbinIp(struct nsjconf_t *nsjconf, const char *const *argv)
-{
-       if (subprocSystem(argv, environ) == 0) {
-               return true;
-       }
-       return false;
-}
 
-bool netInitNsFromParent(struct nsjconf_t * nsjconf, int pid)
+bool netInitNsFromParent(struct nsjconf_t *nsjconf, int pid)
 {
        if (nsjconf->clone_newnet == false) {
                return true;
@@ -135,12 +128,12 @@ bool netInitNsFromParent(struct nsjconf_t * nsjconf, int pid)
        char pid_str[256];
        snprintf(pid_str, sizeof(pid_str), "%d", pid);
 
-       char *const argv_add[] =
+       const char *argv[] =
            { "/sbin/ip", "link", "add", "link", (char *)nsjconf->iface, "name", IFACE_NAME,
                "netns",
                pid_str, "type", "macvlan", "mode", "bridge", NULL
        };
-       if (netSystemSbinIp(nsjconf, argv_add) == false) {
+       if (subprocSystem(argv, environ) != 0) {
                LOG_E("Couldn't create MACVTAP interface for '%s'", nsjconf->iface);
                return false;
        }