diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-06-22 20:28:59 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2004-06-22 20:28:59 +0000 |
commit | 6fea9855664583f52deafa42b35f7320cad8da93 (patch) | |
tree | 03958bbe9997531e60137428ca3852b1405c29eb /usr.sbin/bgpd/rde_rib.c | |
parent | 73fe7b61cd58457249a00cb41a0673dc5db8bbaa (diff) |
Make the RDE IPv6 ready missing is the message handling. The internal
prefix tree changed form a hash table to a per AF RB tree.
OK henning@ some ideas are from Brent Graveland.
Diffstat (limited to 'usr.sbin/bgpd/rde_rib.c')
-rw-r--r-- | usr.sbin/bgpd/rde_rib.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index b1793e85ee9..c93d0498631 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.47 2004/06/22 07:22:31 henning Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.48 2004/06/22 20:28:58 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -178,13 +178,15 @@ void path_remove(struct rde_aspath *asp) { struct prefix *p; + struct bgpd_addr addr; RIB_STAT(path_remove); while ((p = LIST_FIRST(&asp->prefix_h)) != NULL) { /* Commit is done in peer_down() */ + pt_getaddr(p->prefix, &addr); rde_send_pftable(p->aspath->flags.pftable, - &p->prefix->prefix, p->prefix->prefixlen, 1); + &addr, p->prefix->prefixlen, 1); prefix_destroy(p); } @@ -305,14 +307,17 @@ struct prefix * prefix_get(struct rde_aspath *asp, struct bgpd_addr *prefix, int prefixlen) { struct prefix *p; + struct bgpd_addr addr; RIB_STAT(prefix_get); ENSURE(asp != NULL); LIST_FOREACH(p, &asp->prefix_h, path_l) { ENSURE(p->prefix != NULL); - if (p->prefix->prefixlen == prefixlen && - p->prefix->prefix.v4.s_addr == prefix->v4.s_addr) { + if (p->prefix->prefixlen != prefixlen) + continue; + pt_getaddr(p->prefix, &addr); + if (prefix_equal(&addr, prefix, prefixlen)) { ENSURE(p->aspath == asp); return p; } |