diff options
author | 2016-09-11 19:59:25 +0000 | |
---|---|---|
committer | 2016-09-11 19:59:25 +0000 | |
commit | c742f94d762172276995013902edfc584003614a (patch) | |
tree | e94583ac2c76bc54c0d5bb343c86b4ac63469c48 | |
parent | use ECHOLEN to define DEFDATALEN (diff) | |
download | wireguard-openbsd-c742f94d762172276995013902edfc584003614a.tar.xz wireguard-openbsd-c742f94d762172276995013902edfc584003614a.zip |
bring over LEN defines from ping6(8)
-rw-r--r-- | sbin/ping/ping.c | 8 |
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 */ |