summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netinet6/nd6.c13
-rw-r--r--sys/netinet6/nd6_rtr.c5
2 files changed, 16 insertions, 2 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 9c62a91ea1d..ae523e08db8 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6.c,v 1.81 2008/10/15 19:12:18 blambert Exp $ */
+/* $OpenBSD: nd6.c,v 1.82 2009/01/30 11:56:59 rainer Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
@@ -995,7 +995,18 @@ nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info)
static struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK};
struct ifnet *ifp = rt->rt_ifp;
struct ifaddr *ifa;
+ struct nd_defrouter *dr;
+ if (req == RTM_DELETE && (rt->rt_flags & RTF_GATEWAY) &&
+ (IN6_ARE_ADDR_EQUAL(&(satosin6(rt_key(rt)))->sin6_addr,
+ &in6addr_any) && rt_mask(rt) && (rt_mask(rt)->sa_len == 0 ||
+ IN6_ARE_ADDR_EQUAL(&(satosin6(rt_mask(rt)))->sin6_addr,
+ &in6addr_any)))) {
+ dr = defrouter_lookup(&SIN6(gate)->sin6_addr, ifp);
+ if (dr)
+ dr->installed = 0;
+ }
+
if ((rt->rt_flags & RTF_GATEWAY) != 0)
return;
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 80e4160f464..1158ff2f0c6 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_rtr.c,v 1.49 2009/01/30 10:47:46 mcbride Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.50 2009/01/30 11:56:59 rainer Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
@@ -758,6 +758,9 @@ defrtrlist_update(struct nd_defrouter *new)
dr->rtlifetime = new->rtlifetime;
dr->expire = new->expire;
+ if (!dr->installed)
+ defrouter_select();
+
/*
* If the preference does not change, there's no need
* to sort the entries.