summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relay.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 15:06:42 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 15:06:42 +0000
commitf9df24b04109a01708780c4c6eef2b10235177ce (patch)
tree8c35f3578661e30ab2bb9cf48403e39725177bc5 /usr.sbin/relayd/relay.c
parent847ccc0dd10dd15092bb6eb95bc558244d49e39b (diff)
Adapt to <limits.h> universe.
ok millert
Diffstat (limited to 'usr.sbin/relayd/relay.c')
-rw-r--r--usr.sbin/relayd/relay.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c
index 894c26dc06a..eff2ee2db13 100644
--- a/usr.sbin/relayd/relay.c
+++ b/usr.sbin/relayd/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.185 2015/01/16 14:34:51 reyk Exp $ */
+/* $OpenBSD: relay.c,v 1.186 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2006 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -45,6 +45,8 @@
#include "relayd.h"
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
void relay_statistics(int, short, void *);
int relay_dispatch_parent(int, struct privsep_proc *,
struct imsg *);
@@ -1964,7 +1966,7 @@ relay_tls_callback_dh(SSL *ssl, int export, int keylen)
}
/* get built-in params based on the shorter key length */
- dh = relay_tls_get_dhparams(MIN(keylen, maxlen));
+ dh = relay_tls_get_dhparams(MINIMUM(keylen, maxlen));
return (dh);
}
@@ -1994,7 +1996,7 @@ relay_tls_ctx_create(struct relay *rlay)
/* Modify session timeout and cache size*/
SSL_CTX_set_timeout(ctx,
- (long)MIN(rlay->rl_conf.timeout.tv_sec, LONG_MAX));
+ (long)MINIMUM(rlay->rl_conf.timeout.tv_sec, LONG_MAX));
if (proto->cache < -1) {
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
} else if (proto->cache >= -1) {
@@ -2338,7 +2340,7 @@ relay_tls_readcb(int fd, short event, void *arg)
}
if (bufev->wm_read.high != 0)
- howmuch = MIN(sizeof(rbuf), bufev->wm_read.high);
+ howmuch = MINIMUM(sizeof(rbuf), bufev->wm_read.high);
ret = SSL_read(cre->ssl, rbuf, howmuch);
if (ret <= 0) {