diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-07-03 13:54:42 +1000 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-07-04 13:14:22 +0200 |
| commit | b1d400f40ed3507acdc69d1c8d52ce61c8d3b80d (patch) | |
| tree | 8b68a7426153280175525fb30653902aaee262a4 | |
| parent | aaa0482d5aa64b1414dc91f35aa6335138cb14cf (diff) | |
| download | passt-b1d400f40ed3507acdc69d1c8d52ce61c8d3b80d.tar passt-b1d400f40ed3507acdc69d1c8d52ce61c8d3b80d.tar.gz passt-b1d400f40ed3507acdc69d1c8d52ce61c8d3b80d.tar.bz2 passt-b1d400f40ed3507acdc69d1c8d52ce61c8d3b80d.tar.lz passt-b1d400f40ed3507acdc69d1c8d52ce61c8d3b80d.tar.xz passt-b1d400f40ed3507acdc69d1c8d52ce61c8d3b80d.tar.zst passt-b1d400f40ed3507acdc69d1c8d52ce61c8d3b80d.zip | |
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 <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
| -rw-r--r-- | conf.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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; |
