summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-11-16 23:17:52 +0100
committerDaniel Mack <daniel@zonque.org>2015-11-16 23:17:52 +0100
commit933f9caeeb2b3c1b951d330e04beb04226e5a890 (patch)
treedc36a6ddd84b060590c4885db7b6c3e9e91081eb /src/journal
parent5cd6491b71008334daa9965464e038dc3e39948a (diff)
siphash24: let siphash24_finalize() and siphash24() return the result directly
Rather than passing a pointer to return the result, return it directly from the function calls. Also, return the result in native endianess, and let the callers care about the conversion. For hash tables and bloom filters, we don't care, but in order to keep MAC addresses and DHCP client IDs stable, we explicitly convert to LE.
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald-rate-limit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/journald-rate-limit.c b/src/journal/journald-rate-limit.c
index ad78d09294..2d46efe2fa 100644
--- a/src/journal/journald-rate-limit.c
+++ b/src/journal/journald-rate-limit.c
@@ -162,7 +162,7 @@ static JournalRateLimitGroup* journal_rate_limit_group_new(JournalRateLimit *r,
siphash24_init(&state, r->hash_key);
string_hash_func(g->id, &state);
- siphash24_finalize(&g->hash, &state);
+ g->hash = siphash24_finalize(&state);
journal_rate_limit_vacuum(r, ts);
@@ -230,7 +230,7 @@ int journal_rate_limit_test(JournalRateLimit *r, const char *id, int priority, u
siphash24_init(&state, r->hash_key);
string_hash_func(id, &state);
- siphash24_finalize(&h, &state);
+ h = siphash24_finalize(&state);
g = r->buckets[h % BUCKETS_MAX];
LIST_FOREACH(bucket, g, g)