summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2016-09-17 09:17:56 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2016-09-17 09:17:56 +0000
commiteca5b256fb825890ca000e59aa0f8b37ba38b68e (patch)
treefb6c3ac3e20e36fb4d76ea571fc67fe59c2f7d29
parent5c969a5e581c4e92e4132206bbfd75c240a47c76 (diff)
ping(8): The IPv6 header has a payload length field while IPv4 has a
length field for the whole packet. Make some room for IPv6 payload. ping6(8): Sync to ping(8).
-rw-r--r--sbin/ping/ping.c4
-rw-r--r--sbin/ping6/ping6.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index 80c477a3635..76979159464 100644
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping.c,v 1.186 2016/09/17 09:16:32 florian Exp $ */
+/* $OpenBSD: ping.c,v 1.187 2016/09/17 09:17:55 florian Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -167,7 +167,7 @@ int mx_dup_ck = MAX_DUP_CHK;
char rcvd_tbl[MAX_DUP_CHK / 8];
int datalen = DEFDATALEN;
-u_char outpackhdr[IP_MAXPACKET]; /* Max packet size = 65535 */
+u_char outpackhdr[IP_MAXPACKET+sizeof(struct ip)];
u_char *outpack = outpackhdr+sizeof(struct ip);
char BSPACE = '\b'; /* characters written for flood */
char DOT = '.';
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c
index ee6cc612e46..5d88ef3645e 100644
--- a/sbin/ping6/ping6.c
+++ b/sbin/ping6/ping6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping6.c,v 1.198 2016/09/17 09:16:32 florian Exp $ */
+/* $OpenBSD: ping6.c,v 1.199 2016/09/17 09:17:55 florian Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -165,7 +165,8 @@ int mx_dup_ck = MAX_DUP_CHK;
char rcvd_tbl[MAX_DUP_CHK / 8];
int datalen = DEFDATALEN;
-u_char outpack[IPV6_MAXPACKET];
+u_char outpackhdr[IP_MAXPACKET+sizeof(struct ip)];
+u_char *outpack = outpackhdr+sizeof(struct ip);
char BSPACE = '\b'; /* characters written for flood */
char DOT = '.';
char *hostname;