Module Name:    src
Committed By:   thorpej
Date:           Sun May 23 07:17:51 UTC 2021

Modified Files:
        src/sbin/ping6: ping6.c

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

Fixes bin/56198.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sbin/ping6/ping6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/ping6/ping6.c
diff -u src/sbin/ping6/ping6.c:1.103 src/sbin/ping6/ping6.c:1.104
--- src/sbin/ping6/ping6.c:1.103	Tue Apr 24 07:22:32 2018
+++ src/sbin/ping6/ping6.c	Sun May 23 07:17:50 2021
@@ -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);

Reply via email to