Source-Changes-HG archive

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

[src/trunk]: src/sbin/ping Use an explicitly aligned buffer for ip.



details:   https://anonhg.NetBSD.org/src/rev/48aafab652d5
branches:  trunk
changeset: 820568:48aafab652d5
user:      joerg <joerg%NetBSD.org@localhost>
date:      Wed Jan 11 12:13:52 2017 +0000

description:
Use an explicitly aligned buffer for ip.

diffstat:

 sbin/ping/ping.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r d4644b3cfb31 -r 48aafab652d5 sbin/ping/ping.c
--- a/sbin/ping/ping.c  Wed Jan 11 12:12:32 2017 +0000
+++ b/sbin/ping/ping.c  Wed Jan 11 12:13:52 2017 +0000
@@ -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 @@
 {
        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));
 



Home | Main Index | Thread Index | Old Index