summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2016-09-11 19:49:20 +0000
committerflorian <florian@openbsd.org>2016-09-11 19:49:20 +0000
commitd578193b9d5be1352ca835e87ace34ff5b55d132 (patch)
tree8ca6644207c92174396c5434c1055e9ac312bce2
parentstyle; no obj change (diff)
downloadwireguard-openbsd-d578193b9d5be1352ca835e87ace34ff5b55d132.tar.xz
wireguard-openbsd-d578193b9d5be1352ca835e87ace34ff5b55d132.zip
Do not pretend that we can send more than IPV6_MAXPACKET bytes
payload. Sprinkle in some whitespace fixes.
-rw-r--r--sbin/ping6/ping6.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c
index f1979402b55..30b02d59341 100644
--- a/sbin/ping6/ping6.c
+++ b/sbin/ping6/ping6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping6.c,v 1.183 2016/09/11 19:48:12 florian Exp $ */
+/* $OpenBSD: ping6.c,v 1.184 2016/09/11 19:49:20 florian Exp $ */
/* $KAME: ping6.c,v 1.163 2002/10/25 02:19:06 itojun Exp $ */
/*
@@ -117,13 +117,12 @@ struct payload {
u_int8_t mac[SIPHASH_DIGEST_LENGTH];
};
-#define MAXPACKETLEN 131072
#define IP6LEN 40
-#define ICMP6ECHOLEN 8 /* icmp echo header len excluding time */
-#define ICMP6ECHOTMLEN sizeof(struct payload)
+#define ICMP6ECHOLEN 8 /* icmp echo header len excluding time */
+#define ICMP6ECHOTMLEN sizeof(struct payload)
#define EXTRA 256 /* for AH and various other headers. weird. */
#define DEFDATALEN ICMP6ECHOTMLEN
-#define MAXPAYLOAD MAXPACKETLEN - IP6LEN - ICMP6ECHOLEN
+#define MAXPAYLOAD IPV6_MAXPACKET - IP6LEN - ICMP6ECHOLEN
#define MAXWAIT_DEFAULT 10 /* secs to wait for response */
#define A(bit) rcvd_tbl[(bit)>>3] /* identify byte in array */
@@ -169,7 +168,7 @@ struct sockaddr_in6 dst; /* who to ping6 */
int datalen = DEFDATALEN;
int s; /* socket file descriptor */
-u_char outpack[MAXPACKETLEN];
+u_char outpack[IPV6_MAXPACKET];
char BSPACE = '\b'; /* characters written for flood */
char DOT = '.';
char *hostname;