From 705db17b321e58f9ccd397c0b03ee6f3100d5268 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Fri, 19 Nov 2004 09:59:28 +0000 Subject: Only unlink and link the asp in nexthop_modify if the asp is linked. OK henning@ --- usr.sbin/bgpd/rde_rib.c | 11 ++++++----- 1 file 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 @@ -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 -- cgit v1.2.3