diff options
author | Ondrej Filip <feela@network.cz> | 2001-06-09 16:55:10 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2001-06-09 16:55:10 +0200 |
commit | e9d3c3aaea24724c285027154bd9f5ddef8394e0 (patch) | |
tree | e67326729beae873e2ffeb28e23ad3e9ecc15d6a /proto/ospf/neighbor.c | |
parent | ea31425a6191f0b3e181f8a1c7368fc4dfca24b4 (diff) | |
download | bird-e9d3c3aaea24724c285027154bd9f5ddef8394e0.tar bird-e9d3c3aaea24724c285027154bd9f5ddef8394e0.zip |
Bug in next-hop calculation fixed. (For dual connected neighbors.)
Diffstat (limited to 'proto/ospf/neighbor.c')
-rw-r--r-- | proto/ospf/neighbor.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index d22a60e..ca92e9d 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -432,16 +432,25 @@ find_neigh(struct ospf_iface *ifa, u32 rid) return NULL; } + +/* Find a closest neighbor which is at leas 2-Way */ struct ospf_neighbor * find_neigh_noifa(struct proto_ospf *po, u32 rid) { - struct ospf_neighbor *n; + struct ospf_neighbor *n=NULL,*m; struct ospf_iface *ifa; WALK_LIST (ifa, po->iface_list) - if((n=find_neigh(ifa, rid))!=NULL) - return n; - return NULL; + if((m=find_neigh(ifa, rid))!=NULL) + { + if(m->state>=NEIGHBOR_2WAY) + { + if(n==NULL) n=m; + else + if(m->ifa->cost < n->ifa->cost) n=m; + } + } + return n; } struct ospf_area * |