summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2016-09-11 19:59:25 +0000
committerflorian <florian@openbsd.org>2016-09-11 19:59:25 +0000
commitc742f94d762172276995013902edfc584003614a (patch)
treee94583ac2c76bc54c0d5bb343c86b4ac63469c48
parentuse ECHOLEN to define DEFDATALEN (diff)
downloadwireguard-openbsd-c742f94d762172276995013902edfc584003614a.tar.xz
wireguard-openbsd-c742f94d762172276995013902edfc584003614a.zip
bring over LEN defines from ping6(8)
-rw-r--r--sbin/ping/ping.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index 92ee15cc006..ea650a9fd76 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping.c,v 1.175 2016/09/11 19:44:43 florian Exp $ */
+/* $OpenBSD: ping.c,v 1.176 2016/09/11 19:59:25 florian Exp $ */
/* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */
/*
@@ -88,10 +88,12 @@ struct payload {
u_int8_t mac[SIPHASH_DIGEST_LENGTH];
};
-#define DEFDATALEN (64 - 8) /* default data length */
+#define ECHOLEN 8 /* icmp echo header len excluding time */
+#define ECHOTMLEN sizeof(struct payload)
+#define DEFDATALEN (64 - ECHOLEN) /* default data length */
#define MAXIPLEN 60
#define MAXICMPLEN 76
-#define MAXPAYLOAD (IP_MAXPACKET - MAXIPLEN - 8) /* max ICMP payload size */
+#define MAXPAYLOAD (IP_MAXPACKET - MAXIPLEN - ECHOLEN)
#define MAXWAIT_DEFAULT 10 /* secs to wait for response */
#define NROUTES 9 /* number of record route slots */