From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH v2 10/13] conf: Remove unnecessary mode checks from conf_addr()
Date: Wed, 1 Jul 2026 15:31:52 +1000 [thread overview]
Message-ID: <20260701053155.1219264-11-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20260701053155.1219264-1-david@gibson.dropbear.id.au>
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>
---
conf.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/conf.c b/conf.c
index 3614776c..d1889e0c 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;
--
2.54.0
next prev parent reply other threads:[~2026-07-01 5:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 5:31 [PATCH v2 00/13] Rework option parsing in preparation for destination remapping David Gibson
2026-07-01 5:31 ` [PATCH v2 01/13] Makefile: Add missing PESTO_HEADERS variable David Gibson
2026-07-01 5:31 ` [PATCH v2 02/13] conf: Use parameter instead of global in conf_nat() David Gibson
2026-07-01 5:31 ` [PATCH v2 03/13] parse: Start splitting out parsing helpers David Gibson
2026-07-01 5:31 ` [PATCH v2 04/13] conf: Remove duplicate parsing of -F option David Gibson
2026-07-01 5:31 ` [PATCH v2 05/13] conf: Clean up conf_ip4_prefix() David Gibson
2026-07-01 5:31 ` [PATCH v2 06/13] parse: Add helper to parse unsigned integer values David Gibson
2026-07-01 5:31 ` [PATCH v2 07/13] parse: Move parse_port_range() to new parsing framework David Gibson
2026-07-01 5:31 ` [PATCH v2 08/13] parse: Add helpers for parsing IP addresses David Gibson
2026-07-01 5:31 ` [PATCH v2 09/13] conf: Move address configuration into helper function David Gibson
2026-07-01 5:31 ` David Gibson [this message]
2026-07-01 5:31 ` [PATCH v2 11/13] conf: Use new parsing tools to handle -a option David Gibson
2026-07-01 5:31 ` [PATCH v2 12/13] fwd_rule: Allow "all" port specs to be combined with other options David Gibson
2026-07-01 5:31 ` [PATCH v2 13/13] fwd_rule: Rewrite forward rule parsing using parse.c helpers David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260701053155.1219264-11-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).