summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2014-10-27 14:17:02 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2014-10-27 14:17:02 +0000
commit430b59d5bb20e538af23032066ead7946bcb20b9 (patch)
treea173cbd52f436a79dfc70c0192f8faf04d0ca45e
parenta43b31194e975794b16d0966e836f9842bc84b9b (diff)
htonl(ntohl(memcpy'd buf)) seems like the long way around to copy
an IPv4 address. Just memcpy() it.
-rw-r--r--sbin/dhclient/options.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/dhclient/options.c b/sbin/dhclient/options.c
index 77789130183..bfe1f7428c5 100644
--- a/sbin/dhclient/options.c
+++ b/sbin/dhclient/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.71 2014/10/27 13:36:21 krw Exp $ */
+/* $OpenBSD: options.c,v 1.72 2014/10/27 14:17:01 krw Exp $ */
/* DHCP options parsing and reassembly. */
@@ -432,10 +432,10 @@ pretty_print_option(unsigned int code, struct option_data *option,
dp, len, emit_punct);
break;
case 'I':
- foo.s_addr = htonl(getULong(dp));
+ memcpy(&foo.s_addr, dp, sizeof(foo.s_addr));
opcount = snprintf(op, opleft, "%s",
inet_ntoa(foo));
- dp += 4;
+ dp += sizeof(foo.s_addr);
break;
case 'l':
opcount = snprintf(op, opleft, "%ld",