mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
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. Commitfedeb08b6abroke 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 commit2259a03020. Reviewed by: bz Fixes:fedeb08b6a("Introduce scalable route multipath.") Fixes:2259a03020("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
This commit is contained in:
parent
bd206a6f4a
commit
a48df53e42
1 changed files with 3 additions and 3 deletions
|
|
@ -1614,8 +1614,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;
|
||||
|
|
@ -1627,9 +1626,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
|
||||
|
|
|
|||
Loading…
Reference in a new issue