diff options
author | 2004-11-19 09:59:27 +0000 | |
---|---|---|
committer | 2004-11-19 09:59:27 +0000 | |
commit | 710df094977c2faaf7aa820b86825eec764ec240 (patch) | |
tree | e7d3491ef4f28226c5449a64aa00eccc65e92d44 | |
parent | More aggressive strip flags for non debug kernels; this is a noop on some (diff) | |
download | wireguard-openbsd-710df094977c2faaf7aa820b86825eec764ec240.tar.xz wireguard-openbsd-710df094977c2faaf7aa820b86825eec764ec240.zip |
Only unlink and link the asp in nexthop_modify if the asp is linked.
OK henning@
-rw-r--r-- | usr.sbin/bgpd/rde_rib.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index 554757c306a..f39e7b3eafc 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.61 2004/11/10 16:12:11 claudio Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.62 2004/11/19 09:59:27 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -247,9 +247,8 @@ path_link(struct rde_aspath *asp, struct rde_peer *peer) LIST_INSERT_HEAD(head, asp, path_l); LIST_INSERT_HEAD(&peer->path_h, asp, peer_l); asp->peer = peer; - asp->flags |= F_ATTR_LINKED; - nexthop_link(asp); + asp->flags |= F_ATTR_LINKED; } /* @@ -764,9 +763,11 @@ nexthop_modify(struct rde_aspath *asp, struct bgpd_addr *nexthop, int flags, return; nh = nexthop_get(nexthop); - nexthop_unlink(asp); + if (asp->flags & F_ATTR_LINKED) + nexthop_unlink(asp); asp->nexthop = nh; - nexthop_link(asp); + if (asp->flags & F_ATTR_LINKED) + nexthop_link(asp); } void |