Module Name:    src
Committed By:   roy
Date:           Sun Dec 16 08:54:58 UTC 2018

Modified Files:
        src/sys/netinet6: nd6.c

Log Message:
netinet6: only flush prefixes and routers for the given interface.

Unless it's lo0, where we then flush the lot.
The maintains the status-quo with ndp(8) and allows dhcpcd(8) to at least
try and work with kernel RA on one interface and dhcpcd on another.


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/sys/netinet6/nd6.c

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

Modified files:

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.251 src/sys/netinet6/nd6.c:1.252
--- src/sys/netinet6/nd6.c:1.251	Tue Oct 30 05:54:41 2018
+++ src/sys/netinet6/nd6.c	Sun Dec 16 08:54:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.251 2018/10/30 05:54:41 ozaki-r Exp $	*/
+/*	$NetBSD: nd6.c,v 1.252 2018/12/16 08:54:58 roy Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.251 2018/10/30 05:54:41 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.252 2018/12/16 08:54:58 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1884,6 +1884,10 @@ nd6_ioctl(u_long cmd, void *data, struct
 			struct in6_ifaddr *ia, *ia_next;
 			int _s;
 
+			/* Only flush prefixes for the given interface. */
+			if (ifp != lo0ifp && ifp != pfx->ndpr_ifp)
+				continue;
+
 			if (IN6_IS_ADDR_LINKLOCAL(&pfx->ndpr_prefix.sin6_addr))
 				continue; /* XXX */
 
@@ -1953,8 +1957,15 @@ nd6_ioctl(u_long cmd, void *data, struct
 		struct nd_defrouter *drtr, *next;
 
 		ND6_WLOCK();
+#if 0
+		/* XXX Is this really needed? */
 		nd6_defrouter_reset();
+#endif
 		ND_DEFROUTER_LIST_FOREACH_SAFE(drtr, next) {
+			/* Only flush routers for the given interface. */
+			if (ifp != lo0ifp && ifp != drtr->ifp)
+				continue;
+
 			nd6_defrtrlist_del(drtr, NULL);
 		}
 		nd6_defrouter_select();

Reply via email to