summaryrefslogtreecommitdiffstats
path: root/proto/ospf/topology.c
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-06-05 05:46:19 +0200
committerOndrej Filip <feela@network.cz>2000-06-05 05:46:19 +0200
commit88048fb3c970842a16c65b1566ba817871a04eb5 (patch)
tree4fb39a2ba90bfe2c4e166b43ee52f46cf84887af /proto/ospf/topology.c
parent273fd2c16475d3d1275a4fe17443c3ba2b93fbc4 (diff)
downloadbird-88048fb3c970842a16c65b1566ba817871a04eb5.tar
bird-88048fb3c970842a16c65b1566ba817871a04eb5.zip
Small patch to better hash type=2 LSAs.
Diffstat (limited to 'proto/ospf/topology.c')
-rw-r--r--proto/ospf/topology.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c
index 6f89a91..22ebc5e 100644
--- a/proto/ospf/topology.c
+++ b/proto/ospf/topology.c
@@ -439,7 +439,11 @@ ospf_top_hash_u32(u32 a)
static inline unsigned
ospf_top_hash(struct top_graph *f, u32 lsaid, u32 rtrid, u32 type)
{
+#if 1 /* Dirty patch to make rt table calculation work. */
+return (ospf_top_hash_u32(lsaid) + ospf_top_hash_u32((type==LSA_T_NET) ? lsaid : rtrid) + type) & f->hash_mask;
+#else
return (ospf_top_hash_u32(lsaid) + ospf_top_hash_u32(rtrid) + type) & f->hash_mask;
+#endif
}
struct top_graph *
@@ -510,8 +514,21 @@ ospf_hash_find(struct top_graph *f, u32 lsa, u32 rtr, u32 type)
{
struct top_hash_entry *e = f->hash_table[ospf_top_hash(f, lsa, rtr, type)];
+#if 1 /* Dirty patch to make rt table calculation work. */
+ if(type==LSA_T_NET)
+ {
+ while (e && (e->lsa.id != lsa || e->lsa.type != LSA_T_NET ))
+ e = e->next;
+ }
+ else
+ {
+ while (e && (e->lsa.id != lsa || e->lsa.type != type || e->lsa.rt != rtr))
+ e = e->next;
+ }
+#else
while (e && (e->lsa.id != lsa || e->lsa.rt != rtr || e->lsa.type != type))
e = e->next;
+#endif
return e;
}