diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-01-16 11:59:19 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2026-01-18 12:47:47 +0100 |
| commit | b223bec48213060304c09882ce5b3055b15b7e07 (patch) | |
| tree | 029cc7c109fd173a9ae34181d01dc50f809602eb /test/tcp/git: | |
| parent | 0c611bcd312094a3882be44b759d92423ab28b61 (diff) | |
| download | passt-b223bec48213060304c09882ce5b3055b15b7e07.tar passt-b223bec48213060304c09882ce5b3055b15b7e07.tar.gz passt-b223bec48213060304c09882ce5b3055b15b7e07.tar.bz2 passt-b223bec48213060304c09882ce5b3055b15b7e07.tar.lz passt-b223bec48213060304c09882ce5b3055b15b7e07.tar.xz passt-b223bec48213060304c09882ce5b3055b15b7e07.tar.zst passt-b223bec48213060304c09882ce5b3055b15b7e07.zip | |
fwd, tcp, udp: Set up listening sockets based on forward table
Previously we created inbound listening sockets as we parsed the forwarding
options (-t, -u) whereas outbound listening sockets were created during
{tcp,udp}_init(). Now that we have a data structure recording the full
details of the listening options we can move all listening socket creation
to {tcp,udp}_init(). This means that errors for either direction are
detected and reported the same way.
Introduce fwd_listen_sync() which synchronizes the state of listening
sockets to the forwarding rules table, both for fixed and automatic
forwards.
This does cause a change in semantics for "exclude only" port
specifications. Previously an option like -t ~6000 wouldn't cause a
fatal error, as long as we could bind at least one port. Now, it
requires at least one port for each generated rule; that is for each
of the contiguous blocks of ports the specification resolves to. With
typical ephemeral ports settings that's one port each in 1..5999,
6001..32767 and 61000..65535.
Preserving the exact behaviour for this case would require a considerably
more complex data structure, so I'm hoping this is a sufficiently niche
case for the change to be acceptable.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'test/tcp/git:')
0 files changed, 0 insertions, 0 deletions
