diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-12-12 10:34:23 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2006-12-12 10:34:23 +0000 |
commit | 36c0a411a3e76df6a4b131771c7fa3df78bf2b2a (patch) | |
tree | fd89942f852afcec3d3a3eb6d7bc352c1ec88d88 /usr.sbin | |
parent | f37e5cd2c5e59da958468ec19d994069d172e1a0 (diff) |
Change nexthop_delete() to be more obvious what's going on. No functional
change. OK henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/rde_rib.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index 6da515a03f7..0cd2620a45f 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.90 2006/12/12 10:30:33 claudio Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.91 2006/12/12 10:34:22 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -943,19 +943,20 @@ nexthop_unlink(struct rde_aspath *asp) int nexthop_delete(struct nexthop *nh) { + /* nexthop still used by some other aspath */ + if (!LIST_EMPTY(&nh->path_h)) + return (0); + /* either pinned or in a state where it may not be deleted */ if (nh->refcnt > 0 || nh->state == NEXTHOP_LOOKUP) return (0); - if (LIST_EMPTY(&nh->path_h)) { - LIST_REMOVE(nh, nexthop_l); - rde_send_nexthop(&nh->exit_nexthop, 0); + LIST_REMOVE(nh, nexthop_l); + rde_send_nexthop(&nh->exit_nexthop, 0); - rdemem.nexthop_cnt--; - free(nh); - return (1); - } - return (0); + rdemem.nexthop_cnt--; + free(nh); + return (1); } struct nexthop * |