summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-06-01 15:00:19 +0200
committerMartin Mares <mj@ucw.cz>2000-06-01 15:00:19 +0200
commitbc00185e5a2d51d965465f117722fd4189437d24 (patch)
tree78b73dac963322fe34f7cd64a98159b4a6167b92 /proto
parent491cd43b777e46a301ae2a8f5400acaeb28b8ca5 (diff)
downloadbird-bc00185e5a2d51d965465f117722fd4189437d24.tar
bird-bc00185e5a2d51d965465f117722fd4189437d24.zip
Updated to new neighbor cache.
Diffstat (limited to 'proto')
-rw-r--r--proto/bgp/packets.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index 407d059..820d8d3 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -457,12 +457,17 @@ bgp_get_nexthop(struct bgp_proto *bgp, rta *a)
struct eattr *nh = ea_find(a->eattrs, EA_CODE(EAP_BGP, BA_NEXT_HOP));
ASSERT(nh);
nexthop = *(ip_addr *) nh->u.ptr->data;
- if (ipa_equal(nexthop, bgp->local_addr))
+ neigh = neigh_find(&bgp->p, &nexthop, 0);
+ if (neigh)
{
- DBG("BGP: Loop!\n");
- return 0;
+ if (neigh->scope == SCOPE_HOST)
+ {
+ DBG("BGP: Loop!\n");
+ return 0;
+ }
}
- neigh = neigh_find(&bgp->p, &nexthop, 0) ? : bgp->neigh;
+ else
+ neigh = bgp->neigh;
a->gw = neigh->addr;
a->iface = neigh->iface;
return 1;