From 430b59d5bb20e538af23032066ead7946bcb20b9 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Mon, 27 Oct 2014 14:17:02 +0000 Subject: htonl(ntohl(memcpy'd buf)) seems like the long way around to copy an IPv4 address. Just memcpy() it. --- sbin/dhclient/options.c | 6 +++--- 1 file 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", -- cgit v1.2.3