Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet6 netinet6: only flush prefixes and routers for t...



details:   https://anonhg.NetBSD.org/src/rev/c9faddfe8634
branches:  trunk
changeset: 446734:c9faddfe8634
user:      roy <roy%NetBSD.org@localhost>
date:      Sun Dec 16 08:54:58 2018 +0000

description:
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.

diffstat:

 sys/netinet6/nd6.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (45 lines):

diff -r 1aba38899c2e -r c9faddfe8634 sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c        Sun Dec 16 08:47:43 2018 +0000
+++ b/sys/netinet6/nd6.c        Sun Dec 16 08:54:58 2018 +0000
@@ -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 @@
                        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 @@
                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();



Home | Main Index | Thread Index | Old Index