aboutgitcodebugslistschat
path: root/icmp.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-01-16 16:16:10 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-01-22 23:36:38 +0100
commit8534cdbfd1ba716a70b4b1cac15824ba0a171c94 (patch)
tree93f6cc989e6fa7fd182d43526ce3ce2c35546241 /icmp.h
parent2cb2fe6f89152e537ee583c6f74397a42aae11a9 (diff)
downloadpasst-8534cdbfd1ba716a70b4b1cac15824ba0a171c94.tar
passt-8534cdbfd1ba716a70b4b1cac15824ba0a171c94.tar.gz
passt-8534cdbfd1ba716a70b4b1cac15824ba0a171c94.tar.bz2
passt-8534cdbfd1ba716a70b4b1cac15824ba0a171c94.tar.lz
passt-8534cdbfd1ba716a70b4b1cac15824ba0a171c94.tar.xz
passt-8534cdbfd1ba716a70b4b1cac15824ba0a171c94.tar.zst
passt-8534cdbfd1ba716a70b4b1cac15824ba0a171c94.zip
icmp: Don't attempt to handle "wrong direction" ping socket traffic
Linux ICMP "ping" sockets are very specific in what they do. They let userspace send ping requests (ICMP_ECHO or ICMP6_ECHO_REQUEST), and receive matching replies (ICMP_ECHOREPLY or ICMP6_ECHO_REPLY). They don't let you intercept or handle incoming ping requests. In the case of passt/pasta that means we can process echo requests from tap and forward them to a ping socket, then take the replies from the ping socket and forward them to tap. We can't do the reverse: take echo requests from the host and somehow forward them to the guest. There's really no way for something outside to initiate a ping to a passt/pasta connected guest and if there was we'd need an entirely different mechanism to handle it. However, we have some logic to deal with packets going in that reverse direction. Remove it, since it can't ever be used that way. While we're there use defines for the ICMPv6 types, instead of open coded type values. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'icmp.h')
0 files changed, 0 insertions, 0 deletions