From: Robert Swiecki Date: Tue, 18 Oct 2016 11:54:27 +0000 (+0200) Subject: Make it compile w/o libnl3 X-Git-Tag: 1.3~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf71ab14f60e407c258e33a572c9f108fcd5f917;p=platform%2Fupstream%2Fnsjail.git Make it compile w/o libnl3 --- diff --git a/net.c b/net.c index cddca0f..ce29f73 100644 --- 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; }