From 2427917db81045054170de0cedb6615b40ab4d75 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Tue, 15 Jun 2010 20:19:14 +0000 Subject: [PATCH] Fixed bug #29970: DHCP endian issue parsing option responses --- CHANGELOG | 3 +++ src/core/dhcp.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d109c76a..a844cb19 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -220,6 +220,9 @@ HISTORY ++ Bugfixes: + 2010-06-15: Simon Goldschmidt + * dhcp.c: Fixed bug #29970: DHCP endian issue parsing option responses + 2010-06-14: Simon Goldschmidt * autoip.c: Fixed bug #30039: AutoIP does not reuse previous addresses diff --git a/src/core/dhcp.c b/src/core/dhcp.c index e01ef669..cb225177 100644 --- a/src/core/dhcp.c +++ b/src/core/dhcp.c @@ -1434,9 +1434,10 @@ decode_next: value = ntohl(value); } else { LWIP_ASSERT("invalid decode_len", decode_len == 1); + value = ((u8_t*)value)[0]; } - dhcp_got_option(dhcp, decode_idx); - dhcp_set_option_value(dhcp, decode_idx, value); + dhcp_got_option(dhcp, decode_idx); + dhcp_set_option_value(dhcp, decode_idx, value); } if (offset >= q->len) { offset -= q->len;