From d034fb698f2312c02642c539881b1c1e965fc8fe Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 22 Jun 2023 15:46:41 +0200 Subject: conf: Make -a/--address really imply --no-copy-addrs I wrote it in commit message and man page, but not in conf()... Note that -g/--gateway correctly implies --no-copy-routes already. This fixes Podman's tests: podman networking with pasta(1) - IPv4 address assignment podman networking with pasta(1) - IPv4 default route assignment where we pass -a and -g to assign an address and a default gateway that's compatible with it, but -a doesn't disable the copy of addresses, so we ignore -a, and the default gateway is incompatible with the addresses we copy -- hence no routes in the container. Link: https://github.com/containers/podman/pull/18612 Fixes: cc9d16758be6 ("conf, pasta: With --config-net, copy all addresses by default") Signed-off-by: Stefano Brivio --- conf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'conf.c') diff --git a/conf.c b/conf.c index 87dec50..2aa0ae3 100644 --- a/conf.c +++ b/conf.c @@ -1481,6 +1481,9 @@ void conf(struct ctx *c, int argc, char **argv) break; case 'a': + if (c->mode == MODE_PASTA) + c->no_copy_addrs = 1; + if (IN6_IS_ADDR_UNSPECIFIED(&c->ip6.addr) && inet_pton(AF_INET6, optarg, &c->ip6.addr) && !IN6_IS_ADDR_UNSPECIFIED(&c->ip6.addr) && -- cgit v1.2.3