summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde_rib.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-04-07 09:44:12 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-04-07 09:44:12 +0000
commitfb138ccb2d70c270163d288c43e54b23bf546828 (patch)
treed364d3dbba7d9cf1a0cdd11d25df76f1996daebc /usr.sbin/bgpd/rde_rib.c
parent48926e60388205cd5d16a30d9a6a86c97b2d631f (diff)
Call nexthop_delete() a bit later in nexthop_update(). The nh->state needs
to be changed before calling nexthop_delete() or the nexthop will not be correclty removed in the unlikly event when all aspathes move to a different nexthop while the lookup happens. sthen@ agrees with the logic.
Diffstat (limited to 'usr.sbin/bgpd/rde_rib.c')
-rw-r--r--usr.sbin/bgpd/rde_rib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c
index 26f18dce418..9a54f8aa1f5 100644
--- a/usr.sbin/bgpd/rde_rib.c
+++ b/usr.sbin/bgpd/rde_rib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_rib.c,v 1.124 2010/04/06 13:25:08 claudio Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.125 2010/04/07 09:44:11 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -1106,10 +1106,6 @@ nexthop_update(struct kroute_nexthop *msg)
return;
}
- if (nexthop_delete(nh))
- /* nexthop no longer used */
- return;
-
oldstate = nh->state;
if (msg->valid)
nh->state = NEXTHOP_REACH;
@@ -1128,6 +1124,10 @@ nexthop_update(struct kroute_nexthop *msg)
sizeof(nh->nexthop_net));
nh->nexthop_netlen = msg->netlen;
+ if (nexthop_delete(nh))
+ /* nexthop no longer used */
+ return;
+
if (rde_noevaluate())
/*
* if the decision process is turned off there is no need