Module Name:    src
Committed By:   martin
Date:           Fri Jul 13 16:14:23 UTC 2018

Modified Files:
        src/usr.sbin/ndp [netbsd-8]: ndp.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.48.6.1 -r1.48.6.2 src/usr.sbin/ndp/ndp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/ndp/ndp.c
diff -u src/usr.sbin/ndp/ndp.c:1.48.6.1 src/usr.sbin/ndp/ndp.c:1.48.6.2
--- src/usr.sbin/ndp/ndp.c:1.48.6.1	Fri Jul  7 13:57:26 2017
+++ src/usr.sbin/ndp/ndp.c	Fri Jul 13 16:14:23 2018
@@ -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 ifinfo(char *, int, char **)
 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 @@ delete_one(char *host)
 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 @@ delete(struct rt_msghdr *rtm, char *host
 	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;

Reply via email to