commit 2f6ec04dcc8d2ec0050455263b94308f36252825 from: deraadt date: Fri Jan 16 15:06:40 2015 UTC Adapt to universe. ok millert commit - 5f5060604192e435e33ad61a64279cc2942bf6b1 commit + 2f6ec04dcc8d2ec0050455263b94308f36252825 blob - 137d503fc31fca4cfc2682a568b41df28933fc41 blob + 6964a0b70e36ebc6e083c67285249036f8da70db --- ca.c +++ ca.c @@ -1,4 +1,4 @@ -/* $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 @@ -16,7 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include blob - 536fed2d70965c62b5c3ba82c959f90813b9fd78 blob + ba5836b67c5ecb592ba052b8fcd30ef6ac661c11 --- carp.c +++ carp.c @@ -1,4 +1,4 @@ -/* $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 @@ -16,7 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include blob - a32d9306a7a2a96fff2008d00a3e716c8ab85bf3 blob + 3fefb8ad469c95c995d11dfd1c91c00f52adc209 --- check_icmp.c +++ check_icmp.c @@ -1,4 +1,4 @@ -/* $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 @@ -16,7 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include blob - adf9340fe0c483f8937a4c3774e7636e97eef804 blob + 0e22176f64b49db1895714f2e5b1947b9ff0fca6 --- check_script.c +++ check_script.c @@ -1,4 +1,4 @@ -/* $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 @@ -16,7 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include blob - 4e2553ee7e49b57e506d62014a8b4ffb7bfa25ef blob + d439471f8d59818901b69d07e3f40d9b90de0c4d --- check_tcp.c +++ check_tcp.c @@ -1,4 +1,4 @@ -/* $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 @@ -16,7 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include blob - e9c7fb29da863982fb6d16d75f71d7ad9a77ef83 blob + 2272e341e834586d4412cbc610d7818062169680 --- control.c +++ control.c @@ -1,4 +1,4 @@ -/* $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 @@ -17,7 +17,6 @@ */ #include -#include #include #include #include blob - 5459e83461780e76c569d75937b990f55ede86f3 blob + 70748dd8a17224d765164ef6ef0b8b082ebaca1d --- hce.c +++ hce.c @@ -1,4 +1,4 @@ -/* $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 @@ -16,7 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include blob - 7b46db8c344fe1398f4944a7a93de0b19d4b7369 blob + 1c692c2f78bd93c871201596f59261f04ce7a26a --- parse.y +++ parse.y @@ -1,4 +1,4 @@ -/* $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 @@ -150,7 +150,7 @@ typedef struct { enum direction dir; struct { struct sockaddr_storage ss; - char name[MAXHOSTNAMELEN]; + char name[HOST_NAME_MAX+1]; } addr; struct { enum digest_type type; blob - 150642a9a78e79a91b05f401e04e54a118ad0108 blob + c7ddde9390262d753d8e13be3c0b547b52c5a128 --- pfe.c +++ pfe.c @@ -1,4 +1,4 @@ -/* $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 @@ -16,7 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include #include blob - d828f8e2c1248ed5a89fbf29466169915041f309 blob + 19cb4d85bc4fff00486ff521aab8b9f819174764 --- pfe_filter.c +++ pfe_filter.c @@ -1,4 +1,4 @@ -/* $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 @@ -38,6 +38,8 @@ #include +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + #include "relayd.h" struct pfdata { @@ -443,7 +445,7 @@ sync_ruleset(struct relayd *env, struct rdr *rdr, int 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, blob - 715bad81f3036c0678990ef720f3a020942a35d7 blob + 135b935986205b32dc57f6e65400961c8a51d19c --- pfe_route.c +++ pfe_route.c @@ -1,4 +1,4 @@ -/* $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 @@ -75,7 +75,7 @@ sync_routes(struct relayd *env, struct router *rt) { 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)) blob - 894c26dc06a92d2f300487c357bcb7910b88c739 blob + eff2ee2db13c12e4326a5ba4775835223d96f3d2 --- relay.c +++ 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 @@ -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) { blob - b3038deebf09a709e974b4c7d6b22c9266c85031 blob + 99b804d06f5a8cf62367b89d75e9be657722f0e7 --- relay_http.c +++ relay_http.c @@ -1,4 +1,4 @@ -/* $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 @@ -693,7 +693,7 @@ relay_lookup_url(struct ctl_relay_event *cre, const ch 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) blob - df1912218a502b4bb48b34d9212a9d92458db232 blob + ccd85670275e8c5bfd12bf9f44e887ec35266e35 --- relay_udp.c +++ relay_udp.c @@ -1,4 +1,4 @@ -/* $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 @@ -29,6 +29,7 @@ #include #include +#include #include #include #include blob - eceeb2e389306dca0cef1b9cddf40e7d06be4ffa blob + b5fdf917ecf2f429fd32ff03db635b15a54f427b --- relayd.c +++ relayd.c @@ -1,4 +1,4 @@ -/* $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 @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -46,6 +47,8 @@ #include "relayd.h" +#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) + __dead void usage(void); int parent_configure(struct relayd *); @@ -1483,7 +1486,7 @@ socket_rlimit(int maxfd) 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"); } blob - 1da7e9dce949a0368b58067637652d4f706ac286 blob + 1a450d2e1cf43c04ec50627953e90eb3a0174bb8 --- relayd.h +++ relayd.h @@ -1,4 +1,4 @@ -/* $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 @@ -23,7 +23,6 @@ #include -#include /* MAXHOSTNAMELEN */ #include #include #include @@ -126,8 +125,8 @@ struct ctl_script { 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 { @@ -387,7 +386,7 @@ struct host_config { 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; @@ -469,7 +468,7 @@ struct table_config { 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; @@ -683,9 +682,9 @@ struct protocol { 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; @@ -728,7 +727,7 @@ struct relay_config { 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; @@ -813,7 +812,7 @@ TAILQ_HEAD(netroutelist, netroute); 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; blob - 93f7b1e40ea206615ac610650b35d685962eb81c blob + b8133296eaa4159c43069b1261ffbc560c360508 --- ssl.c +++ ssl.c @@ -1,4 +1,4 @@ -/* $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 @@ -17,7 +17,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include #include #include