diff options
author | Martin Mares <mj@ucw.cz> | 2004-05-31 20:16:42 +0200 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2004-05-31 20:16:42 +0200 |
commit | 0077aab4f9041e4d05d2d6916edfb0e15738cb37 (patch) | |
tree | d1cd3d698daf6f4178cfa5866ce6adf33451ac2d /proto/ospf/ospf.c | |
parent | 4ef3dccfa112faddf79fed76a539353b705702b5 (diff) | |
download | bird-0077aab4f9041e4d05d2d6916edfb0e15738cb37.tar bird-0077aab4f9041e4d05d2d6916edfb0e15738cb37.zip |
The code was broken for external /29 to /32 routes. Assuming that you
have one machine publishing a route to 10.1.1.3/32 and another one
publishing a route to 10.1.1.4/32. If the first machine went down the
route to 10.1.1.4/32 was wrongly killed by the old code, leading either
to missing routes or worse to bug()s like "Router parent does not have
next hop" or just segfaults. The patch fixes this but in the long term a
redesign is required here. Note that the patch doesn't worse the
situation, instead it prevents the problems stated. The redesign is
required to handle multiple routes to small subnets properly.
(by Andreas)
Feela, I think that this is at least a good temporary fix, but it's
of course up to you to decide.
Diffstat (limited to 'proto/ospf/ospf.c')
-rw-r--r-- | proto/ospf/ospf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index ebea951..8229d09 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -391,11 +391,12 @@ ospf_rt_notify(struct proto *p, net *n, rte *new, rte *old, ea_list *attrs) u32 pr=ipa_to_u32(n->n.prefix); struct ospf_lsa_ext *ext; int i; + int max=max_ext_lsa(n->n.pxlen); /* Flush old external LSA */ WALK_LIST(oa, po->area_list) { - for(i=0;i<MAXNETS;i++,pr++) + for(i=0;i<max;i++,pr++) { if(en=ospf_hash_find(oa->gr, pr, rtid, LSA_T_EXT)) { |