Module Name:    src
Committed By:   joerg
Date:           Wed Jan 11 12:13:52 UTC 2017

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

Log Message:
Use an explicitly aligned buffer for ip.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sbin/ping/ping.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/ping/ping.c
diff -u src/sbin/ping/ping.c:1.114 src/sbin/ping/ping.c:1.115
--- src/sbin/ping/ping.c:1.114	Sun Dec 18 01:19:34 2016
+++ src/sbin/ping/ping.c	Wed Jan 11 12:13:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping.c,v 1.114 2016/12/18 01:19:34 dholland Exp $	*/
+/*	$NetBSD: ping.c,v 1.115 2017/01/11 12:13:52 joerg Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -58,7 +58,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ping.c,v 1.114 2016/12/18 01:19:34 dholland Exp $");
+__RCSID("$NetBSD: ping.c,v 1.115 2017/01/11 12:13:52 joerg Exp $");
 #endif
 
 #include <stdio.h>
@@ -1781,7 +1781,8 @@ pr_iph(struct icmp *icp,
 {
 	int	hlen;
 	u_char	*cp;
-	struct ip ipb, *ip = &ipb;
+	struct ip __aligned(4) ipb;
+	struct ip *ip = &ipb;
 
 	(void) memcpy(ip, icp->icmp_data, sizeof(*ip));
 

Reply via email to