Source-Changes-HG archive

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

[src/netbsd-8]: src/usr.sbin/ndp Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/db4d736180e3
branches:  netbsd-8
changeset: 851863:db4d736180e3
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jul 13 16:14:23 2018 +0000

description:
Pull up following revision(s) (requested by nonaka in ticket #921):

        usr.sbin/ndp/ndp.c: revision 1.52-1.54

Remove duplicate rtrlist() function prototype.

ndp(8): host_buf should not be used in delete().
host_buf is passed to the argument host of delete() in do_foreach().

Use s6, not mysin.

diffstat:

 usr.sbin/ndp/ndp.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (44 lines):

diff -r 0337010885dd -r db4d736180e3 usr.sbin/ndp/ndp.c
--- a/usr.sbin/ndp/ndp.c        Fri Jul 13 16:10:46 2018 +0000
+++ b/usr.sbin/ndp/ndp.c        Fri Jul 13 16:14:23 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ndp.c,v 1.48.6.1 2017/07/07 13:57:26 martin Exp $      */
+/*     $NetBSD: ndp.c,v 1.48.6.2 2018/07/13 16:14:23 martin Exp $      */
 /*     $KAME: ndp.c,v 1.121 2005/07/13 11:30:13 keiichi Exp $  */
 
 /*
@@ -134,7 +134,6 @@
 static void rtrlist(void);
 static void plist(void);
 static void pfx_flush(void);
-static void rtrlist(void);
 static void rtr_flush(void);
 static void harmonize_rtr(void);
 #ifdef SIOCSDEFIFACE_IN6       /* XXX: check SIOCGDEFIFACE_IN6 as well? */
@@ -476,6 +475,7 @@
 static int
 delete(struct rt_msghdr *rtm, char *host)
 {
+       char delete_host_buf[NI_MAXHOST];
        struct sockaddr_in6 *mysin = &sin_m;
        struct sockaddr_dl *sdl;
 
@@ -491,13 +491,13 @@
        if (rtmsg(RTM_DELETE, rtm) == 0) {
                struct sockaddr_in6 s6 = *mysin; /* XXX: for safety */
 
-               mysin->sin6_scope_id = 0;
-               inet6_putscopeid(mysin, INET6_IS_ADDR_LINKLOCAL);
+               s6.sin6_scope_id = 0;
+               inet6_putscopeid(&s6, INET6_IS_ADDR_LINKLOCAL);
                (void)getnameinfo((struct sockaddr *)(void *)&s6,
-                   (socklen_t)s6.sin6_len, host_buf,
-                   sizeof(host_buf), NULL, 0,
+                   (socklen_t)s6.sin6_len, delete_host_buf,
+                   sizeof(delete_host_buf), NULL, 0,
                    (nflag ? NI_NUMERICHOST : 0));
-               (void)printf("%s (%s) deleted\n", host, host_buf);
+               (void)printf("%s (%s) deleted\n", host, delete_host_buf);
        }
 
        return 0;



Home | Main Index | Thread Index | Old Index