Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/ping6 Make sure the output packet buffer and the contro...



details:   https://anonhg.NetBSD.org/src/rev/69d6811293f8
branches:  trunk
changeset: 379247:69d6811293f8
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun May 23 07:17:50 2021 +0000

description:
Make sure the output packet buffer and the control message buffer
are aligned.

Fixes bin/56198.

diffstat:

 sbin/ping6/ping6.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 5804d9690cb1 -r 69d6811293f8 sbin/ping6/ping6.c
--- a/sbin/ping6/ping6.c        Sun May 23 01:34:17 2021 +0000
+++ b/sbin/ping6/ping6.c        Sun May 23 07:17:50 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ping6.c,v 1.103 2018/04/24 07:22:32 maxv Exp $ */
+/*     $NetBSD: ping6.c,v 1.104 2021/05/23 07:17:50 thorpej Exp $      */
 /*     $KAME: ping6.c,v 1.164 2002/11/16 14:05:37 itojun Exp $ */
 
 /*
@@ -77,7 +77,7 @@ static char sccsid[] = "@(#)ping.c    8.1 (
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ping6.c,v 1.103 2018/04/24 07:22:32 maxv Exp $");
+__RCSID("$NetBSD: ping6.c,v 1.104 2021/05/23 07:17:50 thorpej Exp $");
 #endif
 #endif
 
@@ -201,7 +201,7 @@ static struct sockaddr_in6 src;     /* src a
 static socklen_t srclen;
 static int datalen = DEFDATALEN;
 static int s;                          /* socket file descriptor */
-static u_char outpack[MAXPACKETLEN];
+static u_char outpack[MAXPACKETLEN] __aligned(sizeof(u_long));
 static char BSPACE = '\b';             /* characters written for flood */
 static char DOT = '.';
 static char *hostname;
@@ -923,7 +923,7 @@ doit(u_char *packet, u_int packlen)
 
        for (;;) {
                struct msghdr m;
-               u_char buf[1024];
+               u_long buf[1024 / sizeof(u_long)];
                struct iovec iov[2];
 
                clock_gettime(CLOCK_MONOTONIC, &now);



Home | Main Index | Thread Index | Old Index