Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7-0]: src/usr.sbin/ndp Pull up following revision(s) (requested b...
details: https://anonhg.NetBSD.org/src/rev/373a57f20b65
branches: netbsd-7-0
changeset: 801116:373a57f20b65
user: riz <riz%NetBSD.org@localhost>
date: Tue Jan 26 01:22:13 2016 +0000
description:
Pull up following revision(s) (requested by ozaki-r in ticket #1063):
usr.sbin/ndp/ndp.c: revision 1.46
Don't forget to set sin_scope. From Ryota Ozaki
diffstat:
usr.sbin/ndp/ndp.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diffs (55 lines):
diff -r c6543a30f5bc -r 373a57f20b65 usr.sbin/ndp/ndp.c
--- a/usr.sbin/ndp/ndp.c Sat Jan 16 10:11:11 2016 +0000
+++ b/usr.sbin/ndp/ndp.c Tue Jan 26 01:22:13 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ndp.c,v 1.43 2014/06/05 16:06:49 roy Exp $ */
+/* $NetBSD: ndp.c,v 1.43.4.1 2016/01/26 01:22:13 riz Exp $ */
/* $KAME: ndp.c,v 1.121 2005/07/13 11:30:13 keiichi Exp $ */
/*
@@ -298,6 +298,15 @@
}
static void
+makeaddr(struct sockaddr_in6 *mysin, const void *resp)
+{
+ const struct sockaddr_in6 *res = resp;
+ mysin->sin6_addr = res->sin6_addr;
+ mysin->sin6_scope_id = res->sin6_scope_id;
+ inet6_putscopeid(mysin, INET6_IS_ADDR_LINKLOCAL);
+}
+
+static void
getsocket(void)
{
if (my_s < 0) {
@@ -356,8 +365,7 @@
warnx("%s: %s\n", host, gai_strerror(gai_error));
return 1;
}
- mysin->sin6_addr = ((struct sockaddr_in6 *)(void *)res->ai_addr)->sin6_addr;
- inet6_putscopeid(mysin, INET6_IS_ADDR_LINKLOCAL);
+ makeaddr(mysin, res->ai_addr);
ea = (u_char *)LLADDR(&sdl_m);
if (ndp_ether_aton(eaddr, ea) == 0)
sdl_m.sdl_alen = 6;
@@ -423,8 +431,7 @@
warnx("%s: %s\n", host, gai_strerror(gai_error));
return;
}
- mysin->sin6_addr = ((struct sockaddr_in6 *)(void *)res->ai_addr)->sin6_addr;
- inet6_putscopeid(mysin, INET6_IS_ADDR_LINKLOCAL);
+ makeaddr(mysin, res->ai_addr);
dump(&mysin->sin6_addr, 0);
if (found_entry == 0) {
(void)getnameinfo((struct sockaddr *)(void *)mysin,
@@ -457,8 +464,7 @@
warnx("%s: %s\n", host, gai_strerror(gai_error));
return 1;
}
- mysin->sin6_addr = ((struct sockaddr_in6 *)(void *)res->ai_addr)->sin6_addr;
- inet6_putscopeid(mysin, INET6_IS_ADDR_LINKLOCAL);
+ makeaddr(mysin, res->ai_addr);
if (rtmsg(RTM_GET) < 0)
errx(1, "RTM_GET(%s) failed", host);
mysin = (struct sockaddr_in6 *)(void *)(rtm + 1);
Home |
Main Index |
Thread Index |
Old Index