diff options
author | Maria Matejka <mq@ucw.cz> | 2022-05-30 15:36:54 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-30 15:36:54 +0200 |
commit | 45af19dd99b3c8f954621e09075e8be180e2f731 (patch) | |
tree | 2e25c82a8e13080d589c79ec0478e5127a9404fb /proto/bgp/attrs.c | |
parent | ef3a8138c909baf58c61ddf2edd815eab899d3a6 (diff) | |
parent | 652be92a21f5575e5f74f6abe98eb4200b86776c (diff) |
Merge commit '652be92a21f5575e5f74f6abe98eb4200b86776c' into haugesund
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r-- | proto/bgp/attrs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 9f31c28b..25f115af 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -1465,7 +1465,7 @@ bgp_finish_attrs(struct bgp_parse_state *s, rta *a) #define RBH_FN(a,h) h #define RBH_REHASH bgp_rbh_rehash -#define RBH_PARAMS /8, *2, 2, 2, 8, 20 +#define RBH_PARAMS /8, *2, 2, 2, 12, 20 HASH_DEFINE_REHASH_FN(RBH, struct bgp_bucket) @@ -1607,7 +1607,7 @@ bgp_withdraw_bucket(struct bgp_channel *c, struct bgp_bucket *b) #define PXH_FN(n,i,h) h #define PXH_REHASH bgp_pxh_rehash -#define PXH_PARAMS /8, *2, 2, 2, 8, 24 +#define PXH_PARAMS /8, *2, 2, 2, 12, 24 HASH_DEFINE_REHASH_FN(PXH, struct bgp_prefix) @@ -1633,7 +1633,8 @@ bgp_free_prefix_table(struct bgp_channel *c) static struct bgp_prefix * bgp_get_prefix(struct bgp_channel *c, const net_addr *net, u32 path_id) { - u32 hash = net_hash(net) ^ u32_hash(path_id); + /* We must use a different hash function than the rtable */ + u32 hash = u32_hash(net_hash(net) ^ u32_hash(path_id)); struct bgp_prefix *px = HASH_FIND(c->prefix_hash, PXH, net, path_id, hash); if (px) |