summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/print-bgp.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
committerderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
commitb9fc9a728fce9c4289b7e9a992665e28d5629a54 (patch)
tree72b2433e418dfa1aef5fcf8305617b97979a25d8 /usr.sbin/tcpdump/print-bgp.c
parentimprove checksum parsing slightly. now handles filenames with spaces. (diff)
downloadwireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.tar.xz
wireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.zip
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/tcpdump/print-bgp.c')
-rw-r--r--usr.sbin/tcpdump/print-bgp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/tcpdump/print-bgp.c b/usr.sbin/tcpdump/print-bgp.c
index 61b86c8ebc0..6d8ffa9ea6c 100644
--- a/usr.sbin/tcpdump/print-bgp.c
+++ b/usr.sbin/tcpdump/print-bgp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-bgp.c,v 1.16 2014/01/12 11:26:48 deraadt Exp $ */
+/* $OpenBSD: print-bgp.c,v 1.17 2015/01/16 06:40:21 deraadt Exp $ */
/*
* Copyright (C) 1999 WIDE Project.
@@ -29,7 +29,6 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -40,6 +39,7 @@
#include <stdio.h>
#include <string.h>
#include <netdb.h>
+#include <limits.h>
#include "interface.h"
#include "addrtoname.h"
@@ -409,7 +409,7 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *dat, int len)
int advance;
int tlen, asn_bytes;
const u_char *p;
- char buf[MAXHOSTNAMELEN + 100];
+ char buf[HOST_NAME_MAX+1 + 100];
p = dat;
tlen = len;
@@ -868,7 +868,7 @@ bgp_update_print(const u_char *dat, int length)
#ifdef INET6
printf(" (Withdrawn routes: %d bytes)", len);
#else
- char buf[MAXHOSTNAMELEN + 100];
+ char buf[HOST_NAME_MAX+1 + 100];
int wpfx;
TCHECK2(p[2], len);
@@ -949,7 +949,7 @@ bgp_update_print(const u_char *dat, int length)
if (dat + length > p) {
printf("(NLRI:"); /* ) */
while (dat + length > p) {
- char buf[MAXHOSTNAMELEN + 100];
+ char buf[HOST_NAME_MAX+1 + 100];
i = decode_prefix4(p, buf, sizeof(buf));
if (i == -1) {
printf(" (illegal prefix length)");