From 2c0cac8e7f637bcbedfd374f00fab0ba6547193e Mon Sep 17 00:00:00 2001 From: joerg Date: Wed, 11 Jan 2017 12:13:52 +0000 Subject: [PATCH] Use an explicitly aligned buffer for ip. --- sbin/ping/ping.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 9d3c797d83fb..fb0ad4d9f9d7 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -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 #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 @@ -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));