aboutgitcodebugslistschat
path: root/contrib/qemu
diff options
context:
space:
mode:
authorJon Maloy <jmaloy@redhat.com>2025-03-06 13:00:04 -0500
committerStefano Brivio <sbrivio@redhat.com>2025-03-07 02:21:19 +0100
commit55431f0077b6a25c264bd2492680d7f99815cc5f (patch)
treec307a2a0cc92186af68275fb113068523c6044dc /contrib/qemu
parent82a839be988ecfdb013b5823afc93211200a9f55 (diff)
downloadpasst-55431f0077b6a25c264bd2492680d7f99815cc5f.tar
passt-55431f0077b6a25c264bd2492680d7f99815cc5f.tar.gz
passt-55431f0077b6a25c264bd2492680d7f99815cc5f.tar.bz2
passt-55431f0077b6a25c264bd2492680d7f99815cc5f.tar.lz
passt-55431f0077b6a25c264bd2492680d7f99815cc5f.tar.xz
passt-55431f0077b6a25c264bd2492680d7f99815cc5f.tar.zst
passt-55431f0077b6a25c264bd2492680d7f99815cc5f.zip
udp: create and send ICMPv4 to local peer when applicable
When a local peer sends a UDP message to a non-existing port on an existing remote host, that host will return an ICMP message containing the error code ICMP_PORT_UNREACH, plus the header and the first eight bytes of the original message. If the sender socket has been connected, it uses this message to issue a "Connection Refused" event to the user. Until now, we have only read such events from the externally facing socket, but we don't forward them back to the local sender because we cannot read the ICMP message directly to user space. Because of this, the local peer will hang and wait for a response that never arrives. We now fix this for IPv4 by recreating and forwarding a correct ICMP message back to the internal sender. We synthesize the message based on the information in the extended error structure, plus the returned part of the original message body. Note that for the sake of completeness, we even produce ICMP messages for other error codes. We have noticed that at least ICMP_PROT_UNREACH is propagated as an error event back to the user. Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Jon Maloy <jmaloy@redhat.com> [sbrivio: fix cppcheck warning: udp_send_conn_fail_icmp4() doesn't modify 'in', it can be declared as const] Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'contrib/qemu')
0 files changed, 0 insertions, 0 deletions