Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/dhcp/common Avoid an unaligned access.
details: https://anonhg.NetBSD.org/src/rev/efb0c38695eb
branches: trunk
changeset: 485286:efb0c38695eb
user: thorpej <thorpej%NetBSD.org@localhost>
date: Mon Apr 24 05:38:51 2000 +0000
description:
Avoid an unaligned access.
diffstat:
usr.sbin/dhcp/common/discover.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (26 lines):
diff -r ee0ed53bba22 -r efb0c38695eb usr.sbin/dhcp/common/discover.c
--- a/usr.sbin/dhcp/common/discover.c Mon Apr 24 05:27:51 2000 +0000
+++ b/usr.sbin/dhcp/common/discover.c Mon Apr 24 05:38:51 2000 +0000
@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
-"$Id: discover.c,v 1.1.1.1 2000/04/22 07:11:33 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
+"$Id: discover.c,v 1.2 2000/04/24 05:38:51 thorpej Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -226,10 +226,11 @@
if (ifp -> ifr_addr.sa_family == AF_INET) {
struct iaddr addr;
+ void *ptr;
/* Get a pointer to the address... */
- memcpy (&foo, &ifp -> ifr_addr,
- sizeof ifp -> ifr_addr);
+ ptr = &ifp -> ifr_addr;
+ memcpy (&foo, ptr, sizeof ifp -> ifr_addr);
/* We don't want the loopback interface. */
if (foo.sin_addr.s_addr == htonl (INADDR_LOOPBACK) &&
Home |
Main Index |
Thread Index |
Old Index