summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-04-27 18:29:01 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-04-27 18:29:01 +0200
commit48b0814ace2d05f9fef093d9f309bfa186a6f365 (patch)
tree89c606418a715c944865a173a40c8bd1f6f629af
parent96599c957baa9c82bde91d610ce4f519aead05e9 (diff)
downloadbird-48b0814ace2d05f9fef093d9f309bfa186a6f365.tar
bird-48b0814ace2d05f9fef093d9f309bfa186a6f365.zip
A fix in OSPFv3 next_hop calculation.
-rw-r--r--proto/ospf/rt.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/proto/ospf/rt.c b/proto/ospf/rt.c
index 9e63d2c..643da9a 100644
--- a/proto/ospf/rt.c
+++ b/proto/ospf/rt.c
@@ -1300,10 +1300,15 @@ calc_next_hop(struct ospf_area *oa, struct top_hash_entry *en,
* Next-hop is taken from lladdr field of Link-LSA, en->lb_id
* is computed in link_back().
*/
- struct top_hash_entry *llsa;
- llsa = ospf_hash_find(po->gr, par->nhi->iface->index, en->lb_id, rid, LSA_T_LINK);
+ struct top_hash_entry *lhe;
+ lhe = ospf_hash_find(po->gr, par->nhi->iface->index, en->lb_id, rid, LSA_T_LINK);
- if (!llsa || ipa_zero(llsa->lladdr))
+ if (!lhe)
+ return 0;
+
+ struct ospf_lsa_link *llsa = lhe->lsa_body;
+
+ if (ipa_zero(llsa->lladdr))
return 0;
en->nh = llsa->lladdr;