From: Markus Stenberg Date: Thu, 1 Aug 2013 09:05:56 +0000 (+0200) Subject: Merge remote-tracking branch 'up/master' into hnet X-Git-Tag: debian/1.1+git20160131-1~133^2 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=e3e24645a00ff0aea4760265840bde21baeab3f1;hp=74ef11cad687fd165457f212cfe15bc5ad7a2cd1;p=odhcp6c.git Merge remote-tracking branch 'up/master' into hnet --- diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 1df31cd..fe4cc0b 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -569,6 +569,13 @@ static int dhcpv6_handle_advert(enum dhcpv6_msg orig, struct dhcpv6_server_cand cand = {false, false, 0, 0, {0}, NULL, NULL, 0, 0}; dhcpv6_for_each_option(opt, end, otype, olen, odata) { + if (orig == DHCPV6_MSG_SOLICIT && + (otype == DHCPV6_OPT_IA_PD || otype == DHCPV6_OPT_IA_NA) && + olen > sizeof(struct dhcpv6_ia_hdr)) { + struct dhcpv6_ia_hdr *ia_hdr = (void*)(&odata[-4]); + dhcpv6_parse_ia(&ia_hdr[1], odata + olen); + } + if (otype == DHCPV6_OPT_SERVERID && olen <= 130) { memcpy(cand.duid, odata, olen); cand.duid_len = olen; @@ -600,13 +607,6 @@ static int dhcpv6_handle_advert(enum dhcpv6_msg orig, cand.preference -= 2000; } } - - if (orig == DHCPV6_MSG_SOLICIT && - (otype == DHCPV6_OPT_IA_PD || otype == DHCPV6_OPT_IA_NA) && - olen > sizeof(struct dhcpv6_ia_hdr)) { - struct dhcpv6_ia_hdr *ia_hdr = (void*)(&odata[-4]); - dhcpv6_parse_ia(&ia_hdr[1], odata + olen); - } } if (cand.duid_len > 0) {