diff options
author | 2010-04-07 09:44:11 +0000 | |
---|---|---|
committer | 2010-04-07 09:44:11 +0000 | |
commit | 6cc0f91f701c088a5960eeb76ff9a65ec6cb8171 (patch) | |
tree | 8dff06fdd54b7136769a493ebc663710ecd080e5 | |
parent | rcsdiff doesn't support all diff(1) options, (diff) | |
download | wireguard-openbsd-6cc0f91f701c088a5960eeb76ff9a65ec6cb8171.tar.xz wireguard-openbsd-6cc0f91f701c088a5960eeb76ff9a65ec6cb8171.zip |
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.
-rw-r--r-- | usr.sbin/bgpd/rde_rib.c | 10 |
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 |