aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorFrajo Haider <frajo@frajo.fi>2026-11-15 23:01:54 +0100
committerStefano Brivio <sbrivio@redhat.com>2026-11-17 00:14:24 +0100
commit8a72b30a0c31d1ccf6d98ad9eccd96acbf42afab (patch)
treefbff7a8057f5cbbec179b9e86a404281e1dd7faa
parentbfbd2deae0c39cbfd85cea8fab4271943d546032 (diff)
downloadpasst-8a72b30a0c31d1ccf6d98ad9eccd96acbf42afab.tar
passt-8a72b30a0c31d1ccf6d98ad9eccd96acbf42afab.tar.gz
passt-8a72b30a0c31d1ccf6d98ad9eccd96acbf42afab.tar.bz2
passt-8a72b30a0c31d1ccf6d98ad9eccd96acbf42afab.tar.lz
passt-8a72b30a0c31d1ccf6d98ad9eccd96acbf42afab.tar.xz
passt-8a72b30a0c31d1ccf6d98ad9eccd96acbf42afab.tar.zst
passt-8a72b30a0c31d1ccf6d98ad9eccd96acbf42afab.zip
fwd_rule: Restore forwarding of ephemeral ports for -t auto, -u auto
From an original patch by Frajo: commit 4e09ddf03443 ("conf: Allow user-specified auto-scanned port forwarding ranges") made automatic port forwarding exclude ephemeral ports, consistently with -t all and -u all, and I thought this should actually be desirable, because those ports are ephemeral, after all, and no services should be bound to them. On the other hand, services that can already be contacted on some other port might want to expose additional (ephemeral indeed) ports. So perhaps we should really expose them. Now, Sean reports that this "feature" actually breaks things for the kind (Kubernetes-in-Docker) project, because Docker relies on the rootlesskit integration of pasta, which uses automatic port forwarding instead of explicit configuration. So, feature or not (and I'm fairly convinced it's a bug by now), it causes a regression, so restore the previous behaviour: if ports are automatically forwarded, don't exclude ephemeral ports. Reported-by: Frajo Haider <frajo@frajo.fi> Reported-by: Sean McGinnis <sean.mcginnis@gmail.com> Link: https://bugs.passt.top/show_bug.cgi?id=219 Link: https://github.com/kubernetes-sigs/kind/issues/4293 Fixes: 4e09ddf03443 ("conf: Allow user-specified auto-scanned port forwarding ranges") Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--fwd_rule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fwd_rule.c b/fwd_rule.c
index 312bc60..a1294d6 100644
--- a/fwd_rule.c
+++ b/fwd_rule.c
@@ -694,7 +694,8 @@ static void fwd_rule_parse_ports(struct fwd_table *fwd, bool del, uint8_t proto,
/* Finally handle "all" and exclude only cases */
if (exclude_only) {
- fwd_port_map_ephemeral(exclude);
+ if (!(flags & FWD_SCAN))
+ fwd_port_map_ephemeral(exclude);
fwd_rule_range_except(fwd, del, proto, addr, ifname,
1, NUM_PORTS - 1, exclude,