projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
28e7946
)
gdhcp: The last option in a message was not parsed correctly
author
Jukka Rissanen
<jukka.rissanen@linux.intel.com>
Fri, 26 Apr 2013 06:51:32 +0000
(09:51 +0300)
committer
Patrik Flykt
<patrik.flykt@linux.intel.com>
Fri, 26 Apr 2013 10:06:57 +0000
(13:06 +0300)
If the desired option was last one in the message, then it was
lost because the remaining data calculation was wrong.
gdhcp/common.c
patch
|
blob
|
history
diff --git
a/gdhcp/common.c
b/gdhcp/common.c
index
e8676f8
..
0c433dd
100644
(file)
--- 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++;