diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-16 06:40:24 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-16 06:40:24 +0000 |
commit | 315054f4737a39489e0a14f3a92bff61f1592832 (patch) | |
tree | 62bf010653374ce09b6beb4dfa0414a91457233b /usr.sbin/mrouted | |
parent | 79e3d817585ca08a91e30ad14abe43e2ab70295f (diff) |
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'usr.sbin/mrouted')
-rw-r--r-- | usr.sbin/mrouted/defs.h | 7 | ||||
-rw-r--r-- | usr.sbin/mrouted/igmp.c | 2 | ||||
-rw-r--r-- | usr.sbin/mrouted/pathnames.h | 6 | ||||
-rw-r--r-- | usr.sbin/mrouted/rsrr.c | 9 | ||||
-rw-r--r-- | usr.sbin/mrouted/vif.c | 4 |
5 files changed, 1 insertions, 27 deletions
diff --git a/usr.sbin/mrouted/defs.h b/usr.sbin/mrouted/defs.h index 2fb2ea62f83..f4d3a6acc66 100644 --- a/usr.sbin/mrouted/defs.h +++ b/usr.sbin/mrouted/defs.h @@ -18,7 +18,6 @@ #include <syslog.h> #include <signal.h> #include <string.h> -#include <sys/param.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> @@ -127,12 +126,6 @@ extern char s2[]; extern char s3[]; extern char s4[]; -#if !(defined(BSD) && (BSD >= 199103)) -extern int errno; -extern int sys_nerr; -extern char * sys_errlist[]; -#endif - #ifdef OLD_KERNEL #define MRT_INIT DVMRP_INIT #define MRT_DONE DVMRP_DONE diff --git a/usr.sbin/mrouted/igmp.c b/usr.sbin/mrouted/igmp.c index f32df762bb4..46a652e6c5f 100644 --- a/usr.sbin/mrouted/igmp.c +++ b/usr.sbin/mrouted/igmp.c @@ -328,9 +328,7 @@ send_igmp(u_int32_t src, u_int32_t dst, int type, int code, bzero(&sdst, sizeof(sdst)); sdst.sin_family = AF_INET; -#if (defined(BSD) && (BSD >= 199103)) sdst.sin_len = sizeof(sdst); -#endif sdst.sin_addr.s_addr = dst; if (sendto(igmp_socket, send_buf, ntohs(ip->ip_len), 0, (struct sockaddr *)&sdst, sizeof(sdst)) < 0) { diff --git a/usr.sbin/mrouted/pathnames.h b/usr.sbin/mrouted/pathnames.h index 1bdcfdcd9fe..c1021c7b541 100644 --- a/usr.sbin/mrouted/pathnames.h +++ b/usr.sbin/mrouted/pathnames.h @@ -11,12 +11,6 @@ #define _PATH_MROUTED_CONF "/etc/mrouted.conf" -#if (defined(BSD) && (BSD >= 199103)) #define _PATH_MROUTED_GENID "/var/run/mrouted.genid" #define _PATH_MROUTED_DUMP "/var/tmp/mrouted.dump" #define _PATH_MROUTED_CACHE "/var/tmp/mrouted.cache" -#else -#define _PATH_MROUTED_GENID "/etc/mrouted.genid" -#define _PATH_MROUTED_DUMP "/usr/tmp/mrouted.dump" -#define _PATH_MROUTED_CACHE "/usr/tmp/mrouted.cache" -#endif diff --git a/usr.sbin/mrouted/rsrr.c b/usr.sbin/mrouted/rsrr.c index 317b1f1c673..252cdea2fea 100644 --- a/usr.sbin/mrouted/rsrr.c +++ b/usr.sbin/mrouted/rsrr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsrr.c,v 1.12 2013/04/21 06:42:43 tedu Exp $ */ +/* $OpenBSD: rsrr.c,v 1.13 2015/01/16 06:40:18 deraadt Exp $ */ /* $NetBSD: rsrr.c,v 1.3 1995/12/10 10:07:14 mycroft Exp $ */ /* @@ -40,10 +40,7 @@ #ifdef RSRR #include "defs.h" -#include <sys/param.h> -#if (defined(BSD) && (BSD >= 199103)) #include <stddef.h> -#endif /* Taken from prune.c */ /* @@ -96,13 +93,9 @@ rsrr_init(void) bzero((char *) &serv_addr, sizeof(serv_addr)); serv_addr.sun_family = AF_UNIX; strlcpy(serv_addr.sun_path, RSRR_SERV_PATH, sizeof serv_addr.sun_path); -#if (defined(BSD) && (BSD >= 199103)) servlen = offsetof(struct sockaddr_un, sun_path) + strlen(serv_addr.sun_path); serv_addr.sun_len = servlen; -#else - servlen = sizeof(serv_addr.sun_family) + strlen(serv_addr.sun_path); -#endif if (bind(rsrr_socket, (struct sockaddr *) &serv_addr, servlen) < 0) logit(LOG_ERR, errno, "Can't bind RSRR socket"); diff --git a/usr.sbin/mrouted/vif.c b/usr.sbin/mrouted/vif.c index 7b7a540afc7..a427f427d56 100644 --- a/usr.sbin/mrouted/vif.c +++ b/usr.sbin/mrouted/vif.c @@ -699,9 +699,7 @@ accept_neighbor_request(u_int32_t src, u_int32_t dst) memset(&addr, 0, sizeof addr); addr.sin_family = AF_INET; -#if (defined(BSD) && (BSD >= 199103)) addr.sin_len = sizeof addr; -#endif addr.sin_addr.s_addr = dst; addr.sin_port = htons(2000); /* any port over 1024 will do... */ if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0 @@ -786,9 +784,7 @@ accept_neighbor_request2(u_int32_t src, u_int32_t dst) memset(&addr, 0, sizeof addr); addr.sin_family = AF_INET; -#if (defined(BSD) && (BSD >= 199103)) addr.sin_len = sizeof addr; -#endif addr.sin_addr.s_addr = dst; addr.sin_port = htons(2000); /* any port over 1024 will do... */ if ((udp = socket(AF_INET, SOCK_DGRAM, 0)) < 0 |