From 9717d3e5b882b969d7d803fb13e20e8e44643824 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Mon, 2 Jul 2018 16:48:48 +0200 Subject: [PATCH] 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 --- bgpd/bgp_pbr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); } -- 2.39.5