summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-05-02 13:49:35 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-05-02 13:49:35 +0000
commit96db6b77a39bbc308995edb311224d48605aabc0 (patch)
tree0218a72334348c71ad900d80b889e7528c175df1
parentdcc4a697130f0fffe387e40172316c0ea62876b8 (diff)
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
-rw-r--r--usr.sbin/bgpd/rde.c5
1 files changed, 2 insertions, 3 deletions
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 <henning@openbsd.org>
@@ -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);
}
-