public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Yumei Huang <yuhuang@redhat.com>
Cc: passt-dev@passt.top, david@gibson.dropbear.id.au
Subject: Re: [PATCH v2] conf, pasta: Add --splice-only option
Date: Fri, 16 Jan 2026 04:44:54 +0100	[thread overview]
Message-ID: <20260116044454.3da0958a@elisabeth> (raw)
In-Reply-To: <20260116032509.1480589-1-yuhuang@redhat.com>

On Fri, 16 Jan 2026 11:25:09 +0800
Yumei Huang <yuhuang@redhat.com> wrote:

> This patch introduces a mode where we only forward loopback connections
> and traffic between two namespaces (via the loopback interface, 'lo'),
> without a tap device.
> 
> It might be used to fix up podman IPv4 / IPv6 loopback mapping when using
> rootlesskit for forwarding ports, or a way to implement isolated containers.
> 
> In this mode, --host-lo-to-ns-lo and --no-icmp are automatically enabled.
> Option --no-splice is rejected.
> 
> Link: https://bugs.passt.top/show_bug.cgi?id=149
> Signed-off-by: Yumei Huang <yuhuang@redhat.com>
> ---
>  conf.c  | 39 ++++++++++++++++++++++++++++-----------
>  fwd.c   |  3 +++
>  passt.1 |  5 +++++
>  passt.h |  2 ++
>  pasta.c |  3 +++
>  tap.c   | 11 +++++++----
>  6 files changed, 48 insertions(+), 15 deletions(-)
> 
> diff --git a/conf.c b/conf.c
> index dbff87c..9d88ad7 100644
> --- a/conf.c
> +++ b/conf.c
> @@ -1059,7 +1059,8 @@ pasta_opts:
>  		"  --no-copy-addrs	DEPRECATED:\n"
>  		"			Don't copy all addresses to namespace\n"
>  		"  --ns-mac-addr ADDR	Set MAC address on tap interface\n"
> -		"  --no-splice		Disable inbound socket splicing\n");
> +		"  --no-splice		Disable inbound socket splicing\n"
> +		"  --splice-only	Only enable loopback forwarding\n");
>  
>  	passt_exit(status);
>  }
> @@ -1142,7 +1143,7 @@ static void conf_print(const struct ctx *c)
>  		     inet_ntop(AF_INET6, &c->ip6.addr_out, buf6, sizeof(buf6)));
>  	}
>  
> -	if (c->mode == MODE_PASTA)
> +	if (c->mode == MODE_PASTA && !c->splice_only)
>  		info("Namespace interface: %s", c->pasta_ifn);
>  
>  	info("MAC:");

Actually, I just realised, also the MAC address information printed here
is meaningless for the --splice-only mode:

$ ./pasta --debug --splice-only
0.0019: MAC:
0.0019:     host: 9a:55:9a:55:9a:55

...but that MAC address will never appear anywhere.

But in any case the patch looks good to me (with or without that
"fixed").

-- 
Stefano


  reply	other threads:[~2026-01-16  3:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16  3:25 Yumei Huang
2026-01-16  3:44 ` Stefano Brivio [this message]
2026-01-19  9:08 ` Stefano Brivio

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=20260116044454.3da0958a@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=yuhuang@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).