From 96db6b77a39bbc308995edb311224d48605aabc0 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Fri, 2 May 2008 13:49:35 +0000 Subject: Fix logic when setting the F_RIB_ELIGIBLE flag. A path with a NULL nexthop is localy originated and so is eligible by definition. Noticed and fix tested by Christian, bsd (at) cleondra (dot) ch --- usr.sbin/bgpd/rde.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr.sbin/bgpd/rde.c') diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index df48db0d9b5..6a60a485e81 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.230 2008/02/26 19:58:51 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.231 2008/05/02 13:49:34 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -1717,7 +1717,7 @@ rde_dump_rib_as(struct prefix *p, struct rde_aspath *asp, pid_t pid, int flags) rib.flags |= F_RIB_INTERNAL; if (asp->flags & F_PREFIX_ANNOUNCED) rib.flags |= F_RIB_ANNOUNCE; - if (asp->nexthop != NULL && asp->nexthop->state == NEXTHOP_REACH) + if (asp->nexthop == NULL || asp->nexthop->state == NEXTHOP_REACH) rib.flags |= F_RIB_ELIGIBLE; if (asp->flags & F_ATTR_LOOP) rib.flags &= ~F_RIB_ELIGIBLE; @@ -2846,4 +2846,3 @@ sa_cmp(struct bgpd_addr *a, struct sockaddr *b) return (0); } - -- cgit v1.2.3