aboutgitcodebugslistschat
path: root/conf.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-10-14 12:12:33 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-10-14 13:20:34 +0200
commit1cbd2c8c6b3a564aba84abcd20f05c5c646d2fb4 (patch)
treecf38fc7566c41f16038a47c5a35e15dab56268f4 /conf.c
parentc61944a1f8e4acdf0d86d0813eef50f88e3d7131 (diff)
downloadpasst-1cbd2c8c6b3a564aba84abcd20f05c5c646d2fb4.tar
passt-1cbd2c8c6b3a564aba84abcd20f05c5c646d2fb4.tar.gz
passt-1cbd2c8c6b3a564aba84abcd20f05c5c646d2fb4.tar.bz2
passt-1cbd2c8c6b3a564aba84abcd20f05c5c646d2fb4.tar.lz
passt-1cbd2c8c6b3a564aba84abcd20f05c5c646d2fb4.tar.xz
passt-1cbd2c8c6b3a564aba84abcd20f05c5c646d2fb4.tar.zst
passt-1cbd2c8c6b3a564aba84abcd20f05c5c646d2fb4.zip
conf: Reset netns_only flag after probing
...if we check whether an option might be a namespace specification, and it turns out not to be (e.g. with --pcap), we might set netns_only, but we don't reset it back to 0 if it wasn't set. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/conf.c b/conf.c
index dcba9ae..4960c68 100644
--- a/conf.c
+++ b/conf.c
@@ -369,8 +369,8 @@ static int conf_ns_check(void *arg)
static int conf_ns_opt(struct ctx *c,
char *nsdir, char *conf_userns, const char *optarg)
{
+ int ufd = 0, nfd = 0, try, ret, netns_only_reset = c->netns_only;
char userns[PATH_MAX], netns[PATH_MAX];
- int ufd = 0, nfd = 0, try, ret;
char *endptr;
pid_t pid;
@@ -434,6 +434,8 @@ static int conf_ns_opt(struct ctx *c,
close(ufd);
}
+ c->netns_only = netns_only_reset;
+
return -ENOENT;
}