From f8e62d2283d28bbc15798636529efcefe6f99a8b Mon Sep 17 00:00:00 2001 From: Erik Moqvist Date: Fri, 5 Jun 2020 19:04:00 +0200 Subject: Fix DNS 2 is the DHCP client. --- toys/pending/dhcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'toys/pending/dhcp.c') diff --git a/toys/pending/dhcp.c b/toys/pending/dhcp.c index 2dd392dc..be8d4947 100644 --- a/toys/pending/dhcp.c +++ b/toys/pending/dhcp.c @@ -1136,12 +1136,14 @@ static uint8_t dhcpc_parseoptions(dhcpc_result_t *presult, uint8_t *optptr) msgopt_list[count].len = strlen(toybuf); break; case DHCP_IPLIST: + options = &optptr[2]; optlen = optptr[1]; dest = toybuf; while (optlen) { - memcpy(&convtmp, &optptr[2], sizeof(uint32_t)); + memcpy(&convtmp, options, sizeof(uint32_t)); addr.s_addr = convtmp; dest += sprintf(dest, "%s ", inet_ntoa(addr)); + options += 4; optlen -= 4; } *(dest - 1) = '\0'; -- cgit v1.2.3