Use an explicitly aligned buffer for ip.
This commit is contained in:
parent
a88ba739cb
commit
2c0cac8e7f
@ -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
|
* Copyright (c) 1989, 1993
|
||||||
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#ifndef lint
|
#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
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -1781,7 +1781,8 @@ pr_iph(struct icmp *icp,
|
|||||||
{
|
{
|
||||||
int hlen;
|
int hlen;
|
||||||
u_char *cp;
|
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));
|
(void) memcpy(ip, icp->icmp_data, sizeof(*ip));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user