From b1d400f40ed3507acdc69d1c8d52ce61c8d3b80d Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 3 Jul 2026 13:54:42 +1000 Subject: conf: Remove unnecessary mode checks from conf_addr() conf_addr() sets c->ip[46]no_copy_addrs conditional upon being in pasta mode. That sort of makes sense, since address copying is only a thing for pasta mode. However, setting the variables anyway is harmless, and arguably more logically consistent. If we had a way of copying addresses for passt mode (or some future mode), it would still be incorrect to do so in these circumstances. So, make the assignments unconditional. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- conf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/conf.c b/conf.c index 3614776..d1889e0 100644 --- a/conf.c +++ b/conf.c @@ -1203,13 +1203,11 @@ static bool conf_addr(struct ctx *c, char *arg, uint8_t opt_n) c->ip4.addr = *inany_v4(&addr); c->ip4.prefix_len = prefix_len - 96; c->ip4.addr_fixed = true; - if (c->mode == MODE_PASTA) - c->ip4.no_copy_addrs = true; + c->ip4.no_copy_addrs = true; } else { c->ip6.addr = addr.a6; c->ip6.addr_fixed = true; - if (c->mode == MODE_PASTA) - c->ip6.no_copy_addrs = true; + c->ip6.no_copy_addrs = true; } return is_prefix; -- cgit v1.2.3