projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
openvpn plugin: Fix "Dead assignment" warning.
[collectd.git]
/
src
/
match_hashed.c
diff --git
a/src/match_hashed.c
b/src/match_hashed.c
index
062a7a7
..
ee3101a
100644
(file)
--- a/
src/match_hashed.c
+++ b/
src/match_hashed.c
@@
-158,8
+158,8
@@
static int mh_match (const data_set_t __attribute__((unused)) *ds, /* {{{ */
for (host_ptr = vl->host; *host_ptr != 0; host_ptr++)
{
for (host_ptr = vl->host; *host_ptr != 0; host_ptr++)
{
- /* 2
51 is the largest prime smaller than 256
. */
- hash_val = (hash_val *
251
) + ((uint32_t) *host_ptr);
+ /* 2
184401929 is some appropriately sized prime number
. */
+ hash_val = (hash_val *
UINT32_C (2184401929)
) + ((uint32_t) *host_ptr);
}
DEBUG ("hashed match: host = %s; hash_val = %"PRIu32";", vl->host, hash_val);
}
DEBUG ("hashed match: host = %s; hash_val = %"PRIu32";", vl->host, hash_val);