summaryrefslogtreecommitdiffstats
path: root/usr.sbin/relayd/relay_http.c
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2014-12-18 20:55:01 +0000
committerreyk <reyk@openbsd.org>2014-12-18 20:55:01 +0000
commitacb89df41ab799db61a1eaeb2814b514fde65d32 (patch)
tree6b133f5655249039d7a34a7e3ce8c8948e70ae02 /usr.sbin/relayd/relay_http.c
parentupdate usage() and the list of non-standard (i.e. non-posix) options; (diff)
downloadwireguard-openbsd-acb89df41ab799db61a1eaeb2814b514fde65d32.tar.xz
wireguard-openbsd-acb89df41ab799db61a1eaeb2814b514fde65d32.zip
Update relayd to use siphash instead of sys/hash. The source-hash,
loadbalance and hash modes use a random key by default that can be forced to be a static key with a new configuration argument. With input from Max Fillinger. ok tedu@
Diffstat (limited to 'usr.sbin/relayd/relay_http.c')
-rw-r--r--usr.sbin/relayd/relay_http.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/usr.sbin/relayd/relay_http.c b/usr.sbin/relayd/relay_http.c
index 96aca504ee4..82820ccf420 100644
--- a/usr.sbin/relayd/relay_http.c
+++ b/usr.sbin/relayd/relay_http.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay_http.c,v 1.35 2014/10/25 03:23:49 lteo Exp $ */
+/* $OpenBSD: relay_http.c,v 1.36 2014/12/18 20:55:01 reyk Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -23,7 +23,6 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/tree.h>
-#include <sys/hash.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -1487,12 +1486,8 @@ relay_apply_actions(struct ctl_relay_event *cre, struct kvlist *actions)
value = match->kv_value;
break;
}
- if (!con->se_hashkeyset)
- con->se_hashkey = HASHINIT;
- con->se_hashkey = hash32_str(value, con->se_hashkey);
- con->se_hashkeyset = 1;
- log_debug("%s: hashkey 0x%04x", __func__,
- con->se_hashkey);
+ SipHash24_Update(&con->se_siphashctx,
+ value, strlen(value));
break;
case KEY_OPTION_LOG:
/* perform this later */