aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-10-12 06:46:25 +0200
committerStefano Brivio <sbrivio@redhat.com>2022-10-15 02:10:36 +0200
commitabbe01af59549445fd4995fc3e724caae23dbe27 (patch)
treee64247c98030230e24f141669f2ccb5ca6720f41
parent57e2c066e92310ac630d8dacab9a78def3fb4ec0 (diff)
downloadpasst-abbe01af59549445fd4995fc3e724caae23dbe27.tar
passt-abbe01af59549445fd4995fc3e724caae23dbe27.tar.gz
passt-abbe01af59549445fd4995fc3e724caae23dbe27.tar.bz2
passt-abbe01af59549445fd4995fc3e724caae23dbe27.tar.lz
passt-abbe01af59549445fd4995fc3e724caae23dbe27.tar.xz
passt-abbe01af59549445fd4995fc3e724caae23dbe27.tar.zst
passt-abbe01af59549445fd4995fc3e724caae23dbe27.zip
icmp: Set sin6_scope_id for outbound ICMPv6 echo requests
If we ping a link-local address, we need to pass this to sendto(), as it will obviously fail with -EINVAL otherwise. If we ping other addresses, it's probably a good idea anyway to specify the configured outbound interface here. Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--icmp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/icmp.c b/icmp.c
index 6bd87fd..21ea2d7 100644
--- a/icmp.c
+++ b/icmp.c
@@ -192,6 +192,7 @@ int icmp_tap_handler(const struct ctx *c, int af, const void *addr,
struct sockaddr_in6 sa = {
.sin6_family = AF_INET6,
.sin6_addr = IN6ADDR_ANY_INIT,
+ .sin6_scope_id = c->ifi6,
};
struct icmp6hdr *ih;
int id, s;