public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: passt-dev@passt.top
Cc: Paul Holzinger <pholzing@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH] conf: Make -a/--address really imply --no-copy-addrs
Date: Fri, 23 Jun 2023 00:43:00 +0200	[thread overview]
Message-ID: <20230622224300.2030886-1-sbrivio@redhat.com> (raw)

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 <sbrivio@redhat.com>
---
 conf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/conf.c b/conf.c
index db9d095..16a3e64 100644
--- a/conf.c
+++ b/conf.c
@@ -1502,6 +1502,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)	&&
-- 
@@ -1502,6 +1502,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)	&&
-- 
2.39.2


                 reply	other threads:[~2023-06-22 22:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230622224300.2030886-1-sbrivio@redhat.com \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=pholzing@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).