From: Philippe Guibert Date: Mon, 2 Jul 2018 14:48:48 +0000 (+0200) Subject: bgpd: rework jhash algorithm for bgp_pbr_match entries X-Git-Tag: frr-6.1-dev~135^2~5 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=9717d3e5b882b969d7d803fb13e20e8e44643824;p=matthieu%2Ffrr.git bgpd: rework jhash algorithm for bgp_pbr_match entries Instead of relying on jhash_1word for some parameters that are not 32 bit size, the jash(pointer, len) function is used. Signed-off-by: Philippe Guibert --- diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c index 23440c2d13..8f39ddd2d5 100644 --- a/bgpd/bgp_pbr.c +++ b/bgpd/bgp_pbr.c @@ -835,12 +835,12 @@ uint32_t bgp_pbr_match_hash_key(void *arg) key = jhash_1word(pbm->vrf_id, 0x4312abde); key = jhash_1word(pbm->flags, key); - key = jhash_1word(pbm->pkt_len_min, key); - key = jhash_1word(pbm->pkt_len_max, key); - key = jhash_1word(pbm->tcp_flags, key); - key = jhash_1word(pbm->tcp_mask_flags, key); - key = jhash_1word(pbm->dscp_value, key); - key = jhash_1word(pbm->fragment, key); + key = jhash(&pbm->pkt_len_min, 2, key); + key = jhash(&pbm->pkt_len_max, 2, key); + key = jhash(&pbm->tcp_flags, 2, key); + key = jhash(&pbm->tcp_mask_flags, 2, key); + key = jhash(&pbm->dscp_value, 1, key); + key = jhash(&pbm->fragment, 1, key); return jhash_1word(pbm->type, key); }