summaryrefslogtreecommitdiff
path: root/sbin/route
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
commit315054f4737a39489e0a14f3a92bff61f1592832 (patch)
tree62bf010653374ce09b6beb4dfa0414a91457233b /sbin/route
parent79e3d817585ca08a91e30ad14abe43e2ab70295f (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 'sbin/route')
-rw-r--r--sbin/route/route.c4
-rw-r--r--sbin/route/show.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 4c1bdfbb3c7..621852a70b1 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.170 2014/08/19 12:39:36 mpi Exp $ */
+/* $OpenBSD: route.c,v 1.171 2015/01/16 06:40:00 deraadt Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/sysctl.h>
@@ -46,6 +45,7 @@
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+#include <limits.h>
#include <stdio.h>
#include <ctype.h>
#include <stddef.h>
diff --git a/sbin/route/show.c b/sbin/route/show.c
index 0f9c2e5ba8e..576f6ef41f7 100644
--- a/sbin/route/show.c
+++ b/sbin/route/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.96 2014/05/08 09:28:08 mpi Exp $ */
+/* $OpenBSD: show.c,v 1.97 2015/01/16 06:40:00 deraadt Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -30,7 +30,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
@@ -53,6 +52,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "show.h"
@@ -567,8 +567,8 @@ p_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags, int width)
}
}
-static char line[MAXHOSTNAMELEN];
-static char domain[MAXHOSTNAMELEN];
+static char line[HOST_NAME_MAX+1];
+static char domain[HOST_NAME_MAX+1];
void
p_sockaddr_mpls(struct sockaddr *in, struct sockaddr *out, int flags, int width)