diff options
author | Laurent Vivier <lvivier@redhat.com> | 2024-06-13 14:36:53 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-06-13 15:45:38 +0200 |
commit | 0c335d751a21d6b46bd78dd1118860e84021984b (patch) | |
tree | 9ab3b46d9d9351fee3cd05fdcf6e155123681e10 /conf.c | |
parent | 377b666dc960d4e7faff3f2d17f7e83f2d8f7f10 (diff) | |
download | passt-0c335d751a21d6b46bd78dd1118860e84021984b.tar passt-0c335d751a21d6b46bd78dd1118860e84021984b.tar.gz passt-0c335d751a21d6b46bd78dd1118860e84021984b.tar.bz2 passt-0c335d751a21d6b46bd78dd1118860e84021984b.tar.lz passt-0c335d751a21d6b46bd78dd1118860e84021984b.tar.xz passt-0c335d751a21d6b46bd78dd1118860e84021984b.tar.zst passt-0c335d751a21d6b46bd78dd1118860e84021984b.zip |
vhost-user: compare mode MODE_PASTA and not MODE_PASST
As we are going to introduce the MODE_VU that will act like
the mode MODE_PASST, compare to MODE_PASTA rather than to add
a comparison to MODE_VU when we check for MODE_PASST.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -147,7 +147,7 @@ static void conf_ports(const struct ctx *c, char optname, const char *optarg, if (fwd->mode) goto mode_conflict; - if (c->mode != MODE_PASST) + if (c->mode == MODE_PASTA) die("'all' port forwarding is only allowed for passt"); fwd->mode = FWD_ALL; @@ -1118,7 +1118,7 @@ static void conf_ugid(char *runas, uid_t *uid, gid_t *gid) */ static void conf_open_files(struct ctx *c) { - if (c->mode == MODE_PASST && c->fd_tap == -1) + if (c->mode != MODE_PASTA && c->fd_tap == -1) c->fd_tap_listen = tap_sock_unix_open(c->sock_path); c->pidfile_fd = pidfile_open(c->pidfile); @@ -1285,7 +1285,7 @@ void conf(struct ctx *c, int argc, char **argv) c->no_dhcp_dns = 0; break; case 6: - if (c->mode != MODE_PASST) + if (c->mode == MODE_PASTA) die("--no-dhcp-dns is for passt mode only"); c->no_dhcp_dns = 1; @@ -1297,7 +1297,7 @@ void conf(struct ctx *c, int argc, char **argv) c->no_dhcp_dns_search = 0; break; case 8: - if (c->mode != MODE_PASST) + if (c->mode == MODE_PASTA) die("--no-dhcp-search is for passt mode only"); c->no_dhcp_dns_search = 1; @@ -1352,7 +1352,7 @@ void conf(struct ctx *c, int argc, char **argv) break; case 14: fprintf(stdout, - c->mode == MODE_PASST ? "passt " : "pasta "); + c->mode == MODE_PASTA ? "pasta " : "passt "); fprintf(stdout, VERSION_BLOB); exit(EXIT_SUCCESS); case 15: @@ -1648,7 +1648,7 @@ void conf(struct ctx *c, int argc, char **argv) v6_only = true; break; case '1': - if (c->mode != MODE_PASST) + if (c->mode == MODE_PASTA) die("--one-off is for passt mode only"); if (c->one_off) @@ -1694,7 +1694,7 @@ void conf(struct ctx *c, int argc, char **argv) conf_ugid(runas, &uid, &gid); if (logfile) { - logfile_init(c->mode == MODE_PASST ? "passt" : "pasta", + logfile_init(c->mode == MODE_PASTA ? "pasta" : "passt", logfile, logsize); } |