summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump
diff options
context:
space:
mode:
authorKevin Steves <stevesk@cvs.openbsd.org>2006-08-20 23:39:43 +0000
committerKevin Steves <stevesk@cvs.openbsd.org>2006-08-20 23:39:43 +0000
commit88954832da9b3d5a714d6e160ecf91a63c4fcbf0 (patch)
tree79640964a8c44418d3df3a40ff718f97ecdd0dbf /usr.sbin/tcpdump
parent615fdbc1290895dfc584976841435093a0108d26 (diff)
replace magic numbers, no binary change; prompted by deraadt@
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r--usr.sbin/tcpdump/print-vqp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.sbin/tcpdump/print-vqp.c b/usr.sbin/tcpdump/print-vqp.c
index d085b6ce5c9..2dadd524fc5 100644
--- a/usr.sbin/tcpdump/print-vqp.c
+++ b/usr.sbin/tcpdump/print-vqp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-vqp.c,v 1.5 2006/08/15 17:32:16 stevesk Exp $ */
+/* $OpenBSD: print-vqp.c,v 1.6 2006/08/20 23:39:42 stevesk Exp $ */
/*
* Copyright (c) 2006 Kevin Steves <stevesk@openbsd.org>
@@ -46,7 +46,9 @@
#include <sys/types.h>
#include <sys/socket.h>
+#include <net/if.h>
#include <netinet/in.h>
+#include <netinet/if_ether.h>
#include <arpa/inet.h>
#include <stdio.h>
@@ -156,7 +158,7 @@ vqp_print_type(u_int type, u_int len, const u_char *p)
switch (type) {
case VQP_CLIENT_ADDR:
printf(" client:");
- if (len == 4) {
+ if (len == sizeof(struct in_addr)) {
struct in_addr in;
memcpy(&in, p, sizeof in);
printf("%s", inet_ntoa(in));
@@ -181,7 +183,7 @@ vqp_print_type(u_int type, u_int len, const u_char *p)
break;
case VQP_MAC:
printf(" mac:");
- if (len == 6)
+ if (len == ETHER_ADDR_LEN)
printf("%s", etheraddr_string(p));
else
print_hex(p, len);
@@ -192,7 +194,7 @@ vqp_print_type(u_int type, u_int len, const u_char *p)
break;
case VQP_COOKIE:
printf(" cookie:");
- if (len == 6)
+ if (len == ETHER_ADDR_LEN)
printf("%s", etheraddr_string(p));
else
print_hex(p, len);