aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netinet6/nd6.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c
index 39c4b498e938..70fb468176a5 100644
--- a/sys/netinet6/nd6.c
+++ b/sys/netinet6/nd6.c
@@ -1595,8 +1595,7 @@ check_release_defrouter(const struct rib_cmd_info *rc, void *_cbdata)
struct nhop_object *nh;
nh = rc->rc_nh_old;
-
- if ((nh != NULL) && (nh->nh_flags & NHF_DEFAULT)) {
+ if (rc->rc_cmd == RTM_DELETE && (nh->nh_flags & NHF_DEFAULT) != 0) {
dr = defrouter_lookup(&nh->gw6_sa.sin6_addr, nh->nh_ifp);
if (dr != NULL) {
dr->installed = 0;
@@ -1608,9 +1607,10 @@ check_release_defrouter(const struct rib_cmd_info *rc, void *_cbdata)
void
nd6_subscription_cb(struct rib_head *rnh, struct rib_cmd_info *rc, void *arg)
{
-
#ifdef ROUTE_MPATH
rib_decompose_notification(rc, check_release_defrouter, NULL);
+ if (rc->rc_cmd == RTM_DELETE && !NH_IS_NHGRP(rc->rc_nh_old))
+ check_release_defrouter(rc, NULL);
#else
check_release_defrouter(rc, NULL);
#endif