summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-05-02 13:53:20 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-05-02 13:53:20 +0000
commit93c715a9207d0cdc0efeed608385289f47377649 (patch)
tree5f127899192065aa491e1115f07eeacb3a382d2a /usr.sbin/bgpd
parent96db6b77a39bbc308995edb311224d48605aabc0 (diff)
Compare flags against the right flag field or else unexpected things may
happen. The decision process failed to correctly mask looping pathes and in some szenarios even elected them as best route. *gulp* Found the hard way and fix tested by Christian, bsd (at) cleondra (dot) ch
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r--usr.sbin/bgpd/rde_decide.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/rde_decide.c b/usr.sbin/bgpd/rde_decide.c
index 802e69ec2d4..119a0066e93 100644
--- a/usr.sbin/bgpd/rde_decide.c
+++ b/usr.sbin/bgpd/rde_decide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_decide.c,v 1.49 2007/11/27 01:13:54 claudio Exp $ */
+/* $OpenBSD: rde_decide.c,v 1.50 2008/05/02 13:53:19 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -121,15 +121,15 @@ prefix_cmp(struct prefix *p1, struct prefix *p2)
if (!(p2->flags & F_LOCAL))
return (1);
+ asp1 = p1->aspath;
+ asp2 = p2->aspath;
+
/* only loop free pathes are eligible */
- if (p1->flags & F_ATTR_LOOP)
+ if (asp1->flags & F_ATTR_LOOP)
return (-1);
- if (p2->flags & F_ATTR_LOOP)
+ if (asp2->flags & F_ATTR_LOOP)
return (1);
- asp1 = p1->aspath;
- asp2 = p2->aspath;
-
/* 1. check if prefix is eligible a.k.a reachable */
if (asp2->nexthop != NULL && asp2->nexthop->state != NEXTHOP_REACH)
return (1);