-/* $OpenBSD: ca.c,v 1.10 2014/12/12 10:05:09 reyk Exp $ */
+/* $OpenBSD: ca.c,v 1.11 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/uio.h>
-/* $OpenBSD: carp.c,v 1.9 2012/11/27 05:00:28 guenther Exp $ */
+/* $OpenBSD: carp.c,v 1.10 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
-/* $OpenBSD: check_icmp.c,v 1.38 2014/12/21 00:54:49 guenther Exp $ */
+/* $OpenBSD: check_icmp.c,v 1.39 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/socket.h>
-/* $OpenBSD: check_script.c,v 1.16 2014/06/25 11:05:15 reyk Exp $ */
+/* $OpenBSD: check_script.c,v 1.17 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/wait.h>
-/* $OpenBSD: check_tcp.c,v 1.44 2014/12/12 10:05:09 reyk Exp $ */
+/* $OpenBSD: check_tcp.c,v 1.45 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
-/* $OpenBSD: control.c,v 1.46 2014/07/11 16:39:10 krw Exp $ */
+/* $OpenBSD: control.c,v 1.47 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
*/
#include <sys/queue.h>
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
-/* $OpenBSD: hce.c,v 1.67 2014/12/12 10:05:09 reyk Exp $ */
+/* $OpenBSD: hce.c,v 1.68 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/time.h>
#include <sys/stat.h>
-/* $OpenBSD: parse.y,v 1.199 2014/12/23 13:18:23 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.200 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
enum direction dir;
struct {
struct sockaddr_storage ss;
- char name[MAXHOSTNAMELEN];
+ char name[HOST_NAME_MAX+1];
} addr;
struct {
enum digest_type type;
-/* $OpenBSD: pfe.c,v 1.76 2014/11/19 10:24:40 blambert Exp $ */
+/* $OpenBSD: pfe.c,v 1.77 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
-/* $OpenBSD: pfe_filter.c,v 1.54 2014/12/23 13:18:23 reyk Exp $ */
+/* $OpenBSD: pfe_filter.c,v 1.55 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
#include <openssl/ssl.h>
+#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
+
#include "relayd.h"
struct pfdata {
if (rio.rule.proto == IPPROTO_TCP)
rio.rule.timeout[PFTM_TCP_ESTABLISHED] =
- (u_int32_t)MIN(rdr->conf.timeout.tv_sec, INT_MAX);
+ (u_int32_t)MINIMUM(rdr->conf.timeout.tv_sec, INT_MAX);
if (strlen(rdr->conf.tag))
(void)strlcpy(rio.rule.tagname, rdr->conf.tag,
-/* $OpenBSD: pfe_route.c,v 1.7 2014/12/21 00:54:49 guenther Exp $ */
+/* $OpenBSD: pfe_route.c,v 1.8 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2009 - 2011 Reyk Floeter <reyk@openbsd.org>
{
struct netroute *nr;
struct host *host;
- char buf[MAXHOSTNAMELEN];
+ char buf[HOST_NAME_MAX+1];
struct ctl_netroute crt;
if (!(env->sc_flags & F_NEEDRT))
-/* $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>
#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 *);
}
/* 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);
}
/* 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) {
}
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) {
-/* $OpenBSD: relay_http.c,v 1.40 2015/01/13 09:24:20 reyk Exp $ */
+/* $OpenBSD: relay_http.c,v 1.41 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
struct http_descriptor *desc = (struct http_descriptor *)cre->desc;
int i, j, dots;
char *hi[RELAY_MAXLOOKUPLEVELS], *p, *pp, *c, ch;
- char ph[MAXHOSTNAMELEN];
+ char ph[HOST_NAME_MAX+1];
int ret;
if (desc->http_path == NULL)
-/* $OpenBSD: relay_udp.c,v 1.37 2014/12/21 00:54:49 guenther Exp $ */
+/* $OpenBSD: relay_udp.c,v 1.38 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2007 - 2013 Reyk Floeter <reyk@openbsd.org>
#include <netinet/ip.h>
#include <netinet/tcp.h>
+#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
-/* $OpenBSD: relayd.c,v 1.135 2014/12/18 20:55:01 reyk Exp $ */
+/* $OpenBSD: relayd.c,v 1.136 2015/01/16 15:06:40 deraadt Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <signal.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "relayd.h"
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
__dead void usage(void);
int parent_configure(struct relayd *);
if (maxfd == -1)
rl.rlim_cur = rl.rlim_max;
else
- rl.rlim_cur = MAX(rl.rlim_max, (rlim_t)maxfd);
+ rl.rlim_cur = MAXIMUM(rl.rlim_max, (rlim_t)maxfd);
if (setrlimit(RLIMIT_NOFILE, &rl) == -1)
fatal("socket_rlimit: failed to set resource limit");
}
-/* $OpenBSD: relayd.h,v 1.203 2015/01/13 09:24:21 reyk Exp $ */
+/* $OpenBSD: relayd.h,v 1.204 2015/01/16 15:06:41 deraadt Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
#include <sys/tree.h>
-#include <sys/param.h> /* MAXHOSTNAMELEN */
#include <netinet/in.h>
#include <limits.h>
#include <imsg.h>
objid_t host;
int retval;
struct timeval timeout;
- char name[MAXHOSTNAMELEN];
- char path[MAXPATHLEN];
+ char name[HOST_NAME_MAX+1];
+ char path[PATH_MAX];
};
struct ctl_demote {
objid_t parentid;
objid_t tableid;
int retry;
- char name[MAXHOSTNAMELEN];
+ char name[HOST_NAME_MAX+1];
struct sockaddr_storage ss;
int ttl;
int priority;
int skip_cnt;
char name[TABLE_NAME_SIZE];
size_t name_len;
- char path[MAXPATHLEN];
+ char path[PATH_MAX];
char exbuf[64];
char digest[41]; /* length of sha1 digest * 2 */
u_int8_t digest_type;
char tlsciphers[768];
int tlsdhparams;
int tlsecdhcurve;
- char tlsca[MAXPATHLEN];
- char tlscacert[MAXPATHLEN];
- char tlscakey[MAXPATHLEN];
+ char tlsca[PATH_MAX];
+ char tlscacert[PATH_MAX];
+ char tlscakey[PATH_MAX];
char *tlscapass;
char name[MAX_NAME_SIZE];
int cache;
objid_t id;
u_int32_t flags;
objid_t proto;
- char name[MAXHOSTNAMELEN];
+ char name[HOST_NAME_MAX+1];
in_port_t port;
in_port_t dstport;
int dstretry;
struct router_config {
objid_t id;
u_int32_t flags;
- char name[MAXHOSTNAMELEN];
+ char name[HOST_NAME_MAX+1];
char label[RT_LABEL_SIZE];
int nroutes;
objid_t gwtable;
-/* $OpenBSD: ssl.c,v 1.26 2014/12/12 10:05:09 reyk Exp $ */
+/* $OpenBSD: ssl.c,v 1.27 2015/01/16 15:06:41 deraadt Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>