]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: rework jhash algorithm for bgp_pbr_match entries
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 2 Jul 2018 14:48:48 +0000 (16:48 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 20 Aug 2018 16:33:38 +0000 (18:33 +0200)
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 <philippe.guibert@6wind.com>
bgpd/bgp_pbr.c

index 3af86f007bac7e1939f50507177737f5b94b5665..e91249bdc38de69d238c9f4f69bfd34d56a4fd20 100644 (file)
@@ -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);
 }