diff --git a/neighbor.c b/neighbor.c index 12f5db3..9651f7d 100644 --- a/neighbor.c +++ b/neighbor.c @@ -143,7 +143,7 @@ nbr_init(struct nbr *nbr) memcpy(&rnbr.addr, &nbr->addr, sizeof(rnbr.addr)); rnbr.ifaceid = nbr->ei->ifaceid; if (nbr->flags & F_EIGRP_NBR_SELF) - rnbr.flags = F_RDE_NBR_SELF; + rnbr.flags = F_RDE_NBR_SELF|F_RDE_NBR_LOCAL; /* rde is not aware of pending nbrs */ eigrpe_imsg_compose_rde(IMSG_NEIGHBOR_UP, nbr->peerid, 0, &rnbr, diff --git a/rde.h b/rde.h index 5e0d01a..8a22910 100644 --- a/rde.h +++ b/rde.h @@ -47,8 +47,9 @@ struct rde_nbr { * routes. */ #define F_RDE_NBR_SELF 0x01 -#define F_RDE_NBR_REDIST 0x02 -#define F_RDE_NBR_SUMMARY 0x04 +#define F_RDE_NBR_LOCAL 0x02 +#define F_RDE_NBR_REDIST 0x04 +#define F_RDE_NBR_SUMMARY 0x08 struct reply_node { TAILQ_ENTRY(reply_node) rn_entry; diff --git a/rde_dual.c b/rde_dual.c index 3c2d29c..a5610de 100644 --- a/rde_dual.c +++ b/rde_dual.c @@ -565,16 +565,19 @@ rinfo_fill_infinite(struct rt_node *rn, enum route_type type, struct rinfo *ri) void rt_update_fib(struct rt_node *rn) { - uint8_t maximum_paths = rn->eigrp->maximum_paths; - uint8_t variance = rn->eigrp->variance; + struct eigrp *eigrp = rn->eigrp; + uint8_t maximum_paths = eigrp->maximum_paths; + uint8_t variance = eigrp->variance; int installed = 0; struct eigrp_route *route; if (rn->state == DUAL_STA_PASSIVE) { - TAILQ_FOREACH(route, &rn->routes, entry) { - if (route->nbr->flags & F_RDE_NBR_SELF) - continue; + /* no multipath for attached networks. */ + if (rn->successor.nbr && + (rn->successor.nbr->flags & F_RDE_NBR_LOCAL)) + return; + TAILQ_FOREACH(route, &rn->routes, entry) { /* * only feasible successors and the successor itself * are elegible to be installed. @@ -582,11 +585,6 @@ rt_update_fib(struct rt_node *rn) if (route->rdistance > rn->successor.fdistance) goto uninstall; - /* no multipath for attached networks. */ - if (rn->successor.rdistance == 0 && - route->distance > 0) - goto uninstall; - if (route->distance > (rn->successor.fdistance * variance)) goto uninstall; @@ -661,7 +659,7 @@ rt_get_successor_fc(struct rt_node *rn) * connected routes should always be prefered over * received routes independent of the metric. */ - if (route->rdistance == 0) + if (route->nbr->flags & F_RDE_NBR_LOCAL) return (route); external_only = 0;