From 468f19a85268ac122c2a05cf7a8552eebbbb1bbe Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sun, 14 May 2023 14:14:29 +0200 Subject: conf: --config-net option is for pasta mode only Reported-by: Andrea Arcangeli Signed-off-by: Stefano Brivio Reviewed-by: David Gibson --- conf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'conf.c') diff --git a/conf.c b/conf.c index 1f6bbef..3ee6ae0 100644 --- a/conf.c +++ b/conf.c @@ -1184,7 +1184,6 @@ void conf(struct ctx *c, int argc, char **argv) {"userns", required_argument, NULL, 2 }, {"netns", required_argument, NULL, 3 }, {"netns-only", no_argument, &netns_only, 1 }, - {"config-net", no_argument, &c->pasta_conf_ns, 1 }, {"ns-mac-addr", required_argument, NULL, 4 }, {"dhcp-dns", no_argument, NULL, 5 }, {"no-dhcp-dns", no_argument, NULL, 6 }, @@ -1198,6 +1197,7 @@ void conf(struct ctx *c, int argc, char **argv) {"version", no_argument, NULL, 14 }, {"outbound-if4", required_argument, NULL, 15 }, {"outbound-if6", required_argument, NULL, 16 }, + {"config-net", no_argument, NULL, 17 }, { 0 }, }; struct get_bound_ports_ns_arg ns_ports_arg = { .c = c }; @@ -1355,6 +1355,12 @@ void conf(struct ctx *c, int argc, char **argv) if (ret <= 0 || ret >= (int)sizeof(c->ip6.ifname_out)) die("Invalid interface name: %s", optarg); + break; + case 17: + if (c->mode != MODE_PASTA) + die("--config-net is for pasta mode only"); + + c->pasta_conf_ns = 1; break; case 'd': if (c->debug) -- cgit v1.2.3