-/* $OpenBSD: neighbor.c,v 1.2 2015/10/04 23:00:10 renato Exp $ */
+/* $OpenBSD: neighbor.c,v 1.3 2015/10/27 03:25:55 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
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,
-/* $OpenBSD: rde.h,v 1.4 2015/10/21 03:52:12 renato Exp $ */
+/* $OpenBSD: rde.h,v 1.5 2015/10/27 03:25:55 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
* 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;
-/* $OpenBSD: rde_dual.c,v 1.9 2015/10/25 00:42:02 renato Exp $ */
+/* $OpenBSD: rde_dual.c,v 1.10 2015/10/27 03:25:55 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
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.
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;
* 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;