summaryrefslogtreecommitdiff
path: root/gdhcp
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-04-26 06:51:32 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-26 10:06:57 (GMT)
commitd6b90bace0ba2ca906764dde70213ed3c47f8edd (patch)
tree49e52329e272fcdd38b83a1b115221c459e7dcf9 /gdhcp
parent28e7946111f347cd22f1c872fff66c3725ea3583 (diff)
downloadconnman-d6b90bace0ba2ca906764dde70213ed3c47f8edd.zip
connman-d6b90bace0ba2ca906764dde70213ed3c47f8edd.tar.gz
connman-d6b90bace0ba2ca906764dde70213ed3c47f8edd.tar.bz2
gdhcp: The last option in a message was not parsed correctly
If the desired option was last one in the message, then it was lost because the remaining data calculation was wrong.
Diffstat (limited to 'gdhcp')
-rw-r--r--gdhcp/common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdhcp/common.c b/gdhcp/common.c
index e8676f8..0c433dd 100644
--- a/gdhcp/common.c
+++ b/gdhcp/common.c
@@ -172,8 +172,8 @@ uint8_t *dhcpv6_get_option(struct dhcpv6_packet *packet, uint16_t pkt_len,
if (opt_code == code) {
if (option_len != NULL)
*option_len = opt_len;
- if (rem == 0)
- found = NULL;
+ if (rem < 0)
+ goto bad_packet;
else
found = optionptr + 2 + 2;
count++;