summaryrefslogtreecommitdiff
path: root/accel-pppd/ipv6/dhcpv6_packet.c
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2011-08-30 16:51:22 +0400
committerKozlov Dmitry <xeb@mail.ru>2011-08-30 16:51:22 +0400
commit0f7714076c51430d3243e4d380219bd7d360e43e (patch)
tree539eb928e120979760fbe457f1f227fa21f2c54e /accel-pppd/ipv6/dhcpv6_packet.c
parent1b9fbcc96550160c80b1917bdcec5427ebf37e56 (diff)
downloadaccel-ppp-0f7714076c51430d3243e4d380219bd7d360e43e.tar.gz
accel-ppp-0f7714076c51430d3243e4d380219bd7d360e43e.zip
dhcpv6: various improvments
Diffstat (limited to 'accel-pppd/ipv6/dhcpv6_packet.c')
-rw-r--r--accel-pppd/ipv6/dhcpv6_packet.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/accel-pppd/ipv6/dhcpv6_packet.c b/accel-pppd/ipv6/dhcpv6_packet.c
index 8decc8b6..fd2b0dd5 100644
--- a/accel-pppd/ipv6/dhcpv6_packet.c
+++ b/accel-pppd/ipv6/dhcpv6_packet.c
@@ -82,20 +82,20 @@ static void *parse_option(void *ptr, void *endptr, struct list_head *opt_list)
list_add_tail(&opt->entry, opt_list);
for (dopt = known_options; dopt->code; dopt++) {
- if (dopt->code)
+ if (dopt->code == ntohs(opth->code))
break;
}
if (dopt->len) {
endptr = ptr + sizeof(*opth) + ntohs(opth->len);
- ptr += sizeof(*opth) + dopt->len;
+ ptr += dopt->len;
while (ptr < endptr) {
ptr = parse_option(ptr, endptr, &opt->opt_list);
if (!ptr)
return NULL;
}
} else
- ptr = ptr + sizeof(*opth) + ntohs(opth->len);
+ ptr += sizeof(*opth) + ntohs(opth->len);
return ptr;
}