diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2025-11-19 15:26:33 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-11-21 04:17:14 +0100 |
| commit | fd3fc8d33d6c4344c59a60af16b074515b3da739 (patch) | |
| tree | 2603567c6baa35e569a5fbd460768dd338901ebe /doc/platform-requirements | |
| parent | bdbdf4ed42ef8c30d3008d306ac237c28824221d (diff) | |
| download | passt-fd3fc8d33d6c4344c59a60af16b074515b3da739.tar passt-fd3fc8d33d6c4344c59a60af16b074515b3da739.tar.gz passt-fd3fc8d33d6c4344c59a60af16b074515b3da739.tar.bz2 passt-fd3fc8d33d6c4344c59a60af16b074515b3da739.tar.lz passt-fd3fc8d33d6c4344c59a60af16b074515b3da739.tar.xz passt-fd3fc8d33d6c4344c59a60af16b074515b3da739.tar.zst passt-fd3fc8d33d6c4344c59a60af16b074515b3da739.zip | |
fwd: Exclude ports based on prior mapping state
With auto port-forwarding modes we scan for listening ports on the host
and/or guest and create forwardings for them. To avoid circular forwarding
we need to exclude our own listening ports. We do this by masking out
the forwarding map for one direction from the other.
Since 1bc7d5485c10, some of our scans take place while the forward maps are
out of sync with what our actual listening ports are though: the map
represents what we intend to forward shortly, rather than what we have
open sockets for right now.
What we have sockets for right now is what matters for the purposes of
excluding from the scan, though, so that was incorrect. So, restore
correct behaviour by saving the map of ports to exclude before we start
updating any of the forwarding maps with new scans. This allows us to
keep all the scans separate from all the rebinds, and therefore several
minor cleanups that permitted.
As a bonus, pre-creating the exclusion bitmaps this way should make this
code easier to adapt as we change the forwarding data structures to allow
more flexible configuration.
Fixes: 1bc7d5485c10 ("fwd: Consolidate scans (not rebinds) in fwd.c")
Link: https://bugs.passt.top/show_bug.cgi?id=176
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'doc/platform-requirements')
0 files changed, 0 insertions, 0 deletions
