summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-11-19 09:59:28 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-11-19 09:59:28 +0000
commit705db17b321e58f9ccd397c0b03ee6f3100d5268 (patch)
treeaa0e96ef774fa15daf592ea508a80a5eabb1697d
parent817e2ba2e2532c1c4074dfeeea00df0355f0fb22 (diff)
Only unlink and link the asp in nexthop_modify if the asp is linked.
OK henning@
-rw-r--r--usr.sbin/bgpd/rde_rib.c11
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