diff options
author | Mark Johnston <markj@FreeBSD.org> | 2024-07-25 14:26:36 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2024-08-08 22:41:29 +0000 |
commit | 751c889691cc93087251a5af45b6da796d5d2e85 (patch) | |
tree | 1121b79fd91cc3e6cf959db0e2fb32c45c10771e | |
parent | 4bf6ca0e71e2c726f6e662ea95b5c37d1fabf071 (diff) | |
download | src-751c889691cc93087251a5af45b6da796d5d2e85.tar.gz src-751c889691cc93087251a5af45b6da796d5d2e85.zip |
nd6: Fix the routing table subscription
The nd6 code listens for RTM_DELETE events so that it can mark the
corresponding default router as inactive in the case where the default
route is deleted. A subsequent RA from the router may then reinstall
the default route.
Commit fedeb08b6a58e broke this for non-multipath routes, as
rib_decompose_notification() only invokes the callback for multipath
routes. Restore the old behaviour. Also ensure that we update the
router only for RTM_DELETE notifications, lost in commit 2259a03020fe0.
Approved by: re (cperciva)
Reviewed by: bz
Fixes: fedeb08b6a58 ("Introduce scalable route multipath.")
Fixes: 2259a03020fe ("Rework part of routing code to reduce difference to D26449.")
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Bell Tower Integration
Differential Revision: https://reviews.freebsd.org/D46020
(cherry picked from commit a48df53e4249499be3e8779dd30888a405aa81ae)
(cherry picked from commit c611f050d0dc01bf1f738300365895da84aa5fef)
-rw-r--r-- | sys/netinet6/nd6.c | 6 |
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 |