diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2025-10-31 15:19:29 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-11-01 00:23:06 +0100 |
| commit | 81942a2417357ff10b02ccc8275cde2d4d6fbfbe (patch) | |
| tree | 6ae44b652daff78dc534b186c968bd49b0c4d5cc /test/lib/git:/passt.top | |
| parent | 942bfdb801732e9076ebc90e9d8206513ddbcd90 (diff) | |
| download | passt-81942a2417357ff10b02ccc8275cde2d4d6fbfbe.tar passt-81942a2417357ff10b02ccc8275cde2d4d6fbfbe.tar.gz passt-81942a2417357ff10b02ccc8275cde2d4d6fbfbe.tar.bz2 passt-81942a2417357ff10b02ccc8275cde2d4d6fbfbe.tar.lz passt-81942a2417357ff10b02ccc8275cde2d4d6fbfbe.tar.xz passt-81942a2417357ff10b02ccc8275cde2d4d6fbfbe.tar.zst passt-81942a2417357ff10b02ccc8275cde2d4d6fbfbe.zip | |
fwd: Update all port maps before applying exclusions
In fwd_scan_ports() we go through each of the automatic forwarding cases
(tcp, udp, inbound and outbound) in turn, scanning and calculating the
new forwarding map. However, to avoid avoid circular forwarding, some of
these maps affect each other. This has the odd effect that the ones
handled earlier are based on the previous scan of other maps, whereas
the later ones are based on the latest scan.
That's not generally harmful, but it is counter-intuitive and results in a
few odd edge cases. Avoid this by performing all the scans first, without
regard to other maps, then applying the exclusions afterwards.
One case has an extra wrinkle: for UDP we forwarded not just ports that
were listening on UDP but ones listening on TCP as well, for the benefit of
protocols like iperf3. We therefore also excluded listening ports from
both UDP and TCP from the other direction to avoid circular forwarding.
This doesn't really make sense, though. To avoid circular forwarding, we
don't care *why* the other side is listening on UDP, just that it *is*
listening. This was only needed because the reverse map might have been
one cycle out of date and therefore not included a port opened because of
the corresponding TCP port.
Now that we avoid that out of date map possibility, it's sufficient to
just mask out UDP listening ports in the other direction.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/lib/git:/passt.top')
0 files changed, 0 insertions, 0 deletions
