aboutgitcodebugslistschat
path: root/pasta.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-12-05 15:26:01 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-12-05 21:08:58 +0100
commit1db4f773e87fc77eae2c4965a6bb90fcb56a0ff3 (patch)
treef26685396ff77bd085382392e60105caddf7ce9b /pasta.c
parent966fdc8749048d37a4ffe845388e1ec106eb278d (diff)
downloadpasst-1db4f773e87fc77eae2c4965a6bb90fcb56a0ff3.tar
passt-1db4f773e87fc77eae2c4965a6bb90fcb56a0ff3.tar.gz
passt-1db4f773e87fc77eae2c4965a6bb90fcb56a0ff3.tar.bz2
passt-1db4f773e87fc77eae2c4965a6bb90fcb56a0ff3.tar.lz
passt-1db4f773e87fc77eae2c4965a6bb90fcb56a0ff3.tar.xz
passt-1db4f773e87fc77eae2c4965a6bb90fcb56a0ff3.tar.zst
passt-1db4f773e87fc77eae2c4965a6bb90fcb56a0ff3.zip
udp: Improve detail of UDP endpoint sanity checking
In udp_flow_new() we reject a flow if the endpoint isn't unicast, or it has a zero endpoint port. Those conditions aren't strictly illegal, but we can't safely handle them at present: * Multicast UDP endpoints are certainly possible, but our current flow tracking only makes sense for simple unicast flows - we'll need different handling if we want to handle multicast flows in future * It's not entirely clear if port 0 is RFC-ishly correct, but for socket interfaces port 0 sometimes has a special meaning such as "pick the port for me, kernel". That makes flows on port 0 unsafe to forward in the usual way. For the same reason we also can't safely handle port 0 as our port. In principle that's also true for our address, however in the case of flows initiated from a socket, we may not know our address since the socket could be bound to 0.0.0.0 or ::, so we can only verify that our address is unicast for flows initiated from the tap side. Refine the current check in udp_flow_new() to slightly more detailed checks in udp_flow_from_sock() and udp_flow_from_tap() to make what is and isn't handled clearer. This makes this checking more similar to what we do for TCP connections. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'pasta.c')
0 files changed, 0 insertions, 0 deletions