mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-03 13:43:07 +00:00
conf: fix net type checks in run_script_argv()
Signed-off-by: Jakub Skokan <jakub.skokan@havefun.cz>
This commit is contained in:
parent
465c891a7b
commit
a81442634e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user