diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2013-04-26 09:51:32 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-04-26 13:06:57 +0300 |
commit | d6b90bace0ba2ca906764dde70213ed3c47f8edd (patch) | |
tree | 49e52329e272fcdd38b83a1b115221c459e7dcf9 /gdhcp | |
parent | 28e7946111f347cd22f1c872fff66c3725ea3583 (diff) | |
download | connman-d6b90bace0ba2ca906764dde70213ed3c47f8edd.tar.gz connman-d6b90bace0ba2ca906764dde70213ed3c47f8edd.tar.bz2 connman-d6b90bace0ba2ca906764dde70213ed3c47f8edd.zip |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdhcp/common.c b/gdhcp/common.c index e8676f88..0c433ddc 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++; |