Don't parse IA_NA/IA_PD options if either na_mode or pd_mode is set
to IA_MODE_NONE
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
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));