diff options
| author | Jon Maloy <jmaloy@redhat.com> | 2025-03-06 13:00:06 -0500 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-03-07 02:21:24 +0100 |
| commit | 68b04182e07da6a437479cb191e5468db382bc56 (patch) | |
| tree | f54cd609a51948c8174281b523785c090cf33b38 /contrib/qemu/git: | |
| parent | 87e6a464429372dfaa7212b61e5062dad87179dc (diff) | |
| download | passt-68b04182e07da6a437479cb191e5468db382bc56.tar passt-68b04182e07da6a437479cb191e5468db382bc56.tar.gz passt-68b04182e07da6a437479cb191e5468db382bc56.tar.bz2 passt-68b04182e07da6a437479cb191e5468db382bc56.tar.lz passt-68b04182e07da6a437479cb191e5468db382bc56.tar.xz passt-68b04182e07da6a437479cb191e5468db382bc56.tar.zst passt-68b04182e07da6a437479cb191e5468db382bc56.zip | |
udp: create and send ICMPv6 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 ICMPv6 message containing
the error code ICMP6_DST_UNREACH_NOPORT, plus the IPv6 header, UDP header
and the first 1232 bytes of the original message, if any. 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 IPv6 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 types and 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_icmp6() doesn't
modify saddr which can be declared as const]
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'contrib/qemu/git:')
0 files changed, 0 insertions, 0 deletions
