diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-02-27 14:43:19 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-02-27 14:43:19 +0000 |
commit | 6f4a0ee4f833411758428c824ea231f408103a78 (patch) | |
tree | 851884a9b313a392bd5b91be28fdbbe51ffd1459 /usr.sbin | |
parent | 1717dfd7dfbd2cb5806f0b6419e4a33ee6d1b7cc (diff) |
It is possible to end up in prefix_add with a prefix that needs to be moved.
This caused troubles with show rib because of an ENSURE. OK henning@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/rde_rib.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index cbaac73598f..6502cf3974a 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.36 2004/02/26 16:16:41 claudio Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.37 2004/02/27 14:43:18 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -333,8 +333,12 @@ prefix_add(struct rde_aspath *asp, struct bgpd_addr *prefix, int prefixlen) if (needlink == 1) prefix_link(p, pte, asp); - else + else { + if (p->aspath != asp) + /* prefix belongs to a different aspath so move */ + return prefix_move(asp, p); p->lastchange = time(NULL); + } return pte; } |