aboutgitcodebugslistschat
path: root/contrib/qemu
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2025-04-04 21:15:31 +1100
committerStefano Brivio <sbrivio@redhat.com>2025-04-07 21:24:36 +0200
commitd74b5a7c107006b95df6a69e5f1e6b9a373c7f53 (patch)
tree0be5e604b5c6b052b795580a7bb9967ae8f8bb12 /contrib/qemu
parenta7775e9550fa698e4af1322f6ef63924c24d1fab (diff)
downloadpasst-d74b5a7c107006b95df6a69e5f1e6b9a373c7f53.tar
passt-d74b5a7c107006b95df6a69e5f1e6b9a373c7f53.tar.gz
passt-d74b5a7c107006b95df6a69e5f1e6b9a373c7f53.tar.bz2
passt-d74b5a7c107006b95df6a69e5f1e6b9a373c7f53.tar.lz
passt-d74b5a7c107006b95df6a69e5f1e6b9a373c7f53.tar.xz
passt-d74b5a7c107006b95df6a69e5f1e6b9a373c7f53.tar.zst
passt-d74b5a7c107006b95df6a69e5f1e6b9a373c7f53.zip
udp: Use connect()ed sockets for initiating side
Currently we have an asymmetry in how we handle UDP sockets. For flows where the target side is a socket, we create a new connect()ed socket - the "reply socket" specifically for that flow used for sending and receiving datagrams on that flow and only that flow. For flows where the initiating side is a socket, we continue to use the "listening" socket (or rather, a dup() of it). This has some disadvantages: * We need a hash lookup for every datagram on the listening socket in order to work out what flow it belongs to * The dup() keeps the socket alive even if automatic forwarding removes the listening socket. However, the epoll data remains the same including containing the now stale original fd. This causes bug 103. * We can't (easily) set flow-specific options on an initiating side socket, because that could affect other flows as well Alter the code to use a connect()ed socket on the initiating side as well as the target side. There's no way to "clone and connect" the listening socket (a loose equivalent of accept() for UDP), so we have to create a new socket. We have to bind() this socket before we connect() it, which is allowed thanks to SO_REUSEADDR, but does leave a small window where it could receive datagrams not intended for this flow. For now we handle this by simply discarding any datagrams received between bind() and connect(), but I intend to improve this in a later patch. Link: https://bugs.passt.top/show_bug.cgi?id=103 Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'contrib/qemu')
0 files changed, 0 insertions, 0 deletions