projects
/
project
/
odhcp6c.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dhcpv6: avoid parsing unncessary IAs
[project/odhcp6c.git]
/
src
/
dhcpv6.c
diff --git
a/src/dhcpv6.c
b/src/dhcpv6.c
index 857cbe1ce1b52c408d4ce22befc829c00e3b7b09..5378010310d1ae35b29fd7ef1b5c9b0f0a5115f8 100644
(file)
--- a/
src/dhcpv6.c
+++ b/
src/dhcpv6.c
@@
-862,7
+862,8
@@
static int dhcpv6_handle_advert(enum dhcpv6_msg orig, const int rc,
dhcpv6_for_each_option(opt, end, otype, olen, odata) {
if (orig == DHCPV6_MSG_SOLICIT &&
dhcpv6_for_each_option(opt, end, otype, olen, odata) {
if (orig == DHCPV6_MSG_SOLICIT &&
- (otype == DHCPV6_OPT_IA_PD || otype == DHCPV6_OPT_IA_NA) &&
+ ((otype == DHCPV6_OPT_IA_PD && pd_mode != IA_MODE_NONE) ||
+ (otype == DHCPV6_OPT_IA_NA && na_mode != IA_MODE_NONE)) &&
olen > -4 + sizeof(struct dhcpv6_ia_hdr)) {
struct dhcpv6_ia_hdr *ia_hdr = (void*)(&odata[-4]);
dhcpv6_parse_ia(ia_hdr, odata + olen + sizeof(*ia_hdr));
olen > -4 + sizeof(struct dhcpv6_ia_hdr)) {
struct dhcpv6_ia_hdr *ia_hdr = (void*)(&odata[-4]);
dhcpv6_parse_ia(ia_hdr, odata + olen + sizeof(*ia_hdr));