[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 04067) ping6: set scope for bind with link local address



Hi all

I think I found a bug.
I specified interface and link-local address to -I option.
but command error.

The error message is following:

    # ping6  -Ieth2 -Ife80::215:17ff:fe2e:cbe4 ff02::1
    ping: bind icmp socket: Invalid argument

Attached patch fixes this problem.
Could you please check this patch?



--- iputils-s20071127/ping6.c.orig	2007-11-27 09:57:27.000000000 +0900
+++ iputils-s20071127/ping6.c	2008-07-18 16:14:15.000000000 +0900
@@ -423,6 +423,7 @@ int main(int argc, char *argv[])
 		ipi = (struct in6_pktinfo*)CMSG_DATA(cmsg);
 		memset(ipi, 0, sizeof(*ipi));
 		ipi->ipi6_ifindex = ifr.ifr_ifindex;
+		source.sin6_scope_id = ifr.ifr_ifindex;
 	}

 	if ((whereto.sin6_addr.s6_addr16[0]&htons(0xff00)) == htons (0xff00)) {



Regards,
Naohiro Ooiwa