Date: Wed, 4 Sep 2024 12:50:26 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: b6d6674fecbd - stable/13 - nd6: Fix the routing table subscription Message-ID: <202409041250.484CoQit005229@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b6d6674fecbdb9a752a893860938837ef76e8cf7 commit b6d6674fecbdb9a752a893860938837ef76e8cf7 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-07-25 14:26:36 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-09-04 12:49:50 +0000 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. 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) --- sys/netinet6/nd6.c | 6 +++--- 1 file 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409041250.484CoQit005229>