aboutgitcodebugslistschat
path: root/udp.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-09-20 14:12:41 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-09-25 19:03:15 +0200
commit204e77cd11b2df720c9acd35d562e1ed868304b4 (patch)
treece3581d818e00d0662fde4bdb146b1e7ae1c260a /udp.h
parent8f8c4d27eb2e023fd80986d8fdf8a68b37e3877e (diff)
downloadpasst-204e77cd11b2df720c9acd35d562e1ed868304b4.tar
passt-204e77cd11b2df720c9acd35d562e1ed868304b4.tar.gz
passt-204e77cd11b2df720c9acd35d562e1ed868304b4.tar.bz2
passt-204e77cd11b2df720c9acd35d562e1ed868304b4.tar.lz
passt-204e77cd11b2df720c9acd35d562e1ed868304b4.tar.xz
passt-204e77cd11b2df720c9acd35d562e1ed868304b4.tar.zst
passt-204e77cd11b2df720c9acd35d562e1ed868304b4.zip
udp: Don't attempt to get dual-stack sockets in nonsensical cases
To save some kernel memory we try to use "dual stack" sockets (that listen to both IPv4 and IPv6 traffic) when possible. However udp_sock_init() attempts to do this in some cases that can't work. Specifically we can only do this when listening on any address. That's never true for the ns (splicing) case, because we always listen on loopback. For the !ns case and AF_UNSPEC case, addr should always be NULL, but add an assert to verify. This is harmless: if addr is non-NULL, sock_l4() will just fail and we'll fall back to the other path. But, it's messy and makes some upcoming changes harder, so avoid attempting this in cases we know can't work. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'udp.h')
0 files changed, 0 insertions, 0 deletions