]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Updated to new neighbor cache.
authorMartin Mares <mj@ucw.cz>
Thu, 1 Jun 2000 13:00:19 +0000 (13:00 +0000)
committerMartin Mares <mj@ucw.cz>
Thu, 1 Jun 2000 13:00:19 +0000 (13:00 +0000)
proto/bgp/packets.c

index 407d059b853f9c9c64cb8eba9f311a651e2420e0..820d8d32d44092072bdd76c15695f007b9518d7d 100644 (file)
@@ -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;