From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 174715A0267; Wed, 12 Oct 2022 17:45:30 +0200 (CEST) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] icmp: Set sin6_scope_id for outbound ICMPv6 echo requests Date: Wed, 12 Oct 2022 17:45:30 +0200 Message-Id: <20221012154530.1650534-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: JAELOXMT37K4C6URBXV7Y4DAYEVKE5G3 X-Message-ID-Hash: JAELOXMT37K4C6URBXV7Y4DAYEVKE5G3 X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: <> Archived-At: List-Archive: <> List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- icmp.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.35.1