From: Jakub Skokan Date: Thu, 12 Apr 2018 18:01:43 +0000 (+0200) Subject: conf: fix net type checks in run_script_argv() X-Git-Tag: lxc-3.1.0~330^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a81442634ed8ef08ba428a529e3ec83e6aad72be;p=thirdparty%2Flxc.git conf: fix net type checks in run_script_argv() Signed-off-by: Jakub Skokan --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 283a58218..a6e600ff9 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -440,7 +440,7 @@ int run_script_argv(const char *name, unsigned int hook_version, parent = argv[1] ? argv[1] : ""; - if (strcmp(argv[0], "macvlan")) { + if (strcmp(argv[0], "macvlan") == 0) { ret = setenv("LXC_NET_PARENT", parent, 1); if (ret < 0) { SYSERROR("Failed to set environment " @@ -448,7 +448,7 @@ int run_script_argv(const char *name, unsigned int hook_version, goto on_error; } TRACE("Set environment variable: LXC_NET_PARENT=%s", parent); - } else if (strcmp(argv[0], "phys")) { + } else if (strcmp(argv[0], "phys") == 0) { ret = setenv("LXC_NET_PARENT", parent, 1); if (ret < 0) { SYSERROR("Failed to set environment " @@ -456,7 +456,7 @@ int run_script_argv(const char *name, unsigned int hook_version, goto on_error; } TRACE("Set environment variable: LXC_NET_PARENT=%s", parent); - } else if (strcmp(argv[0], "veth")) { + } else if (strcmp(argv[0], "veth") == 0) { char *peer = argv[2] ? argv[2] : ""; ret = setenv("LXC_NET_PEER", peer, 1);