From: Steven Barth Date: Tue, 17 Feb 2015 17:43:35 +0000 (+0100) Subject: Merge pull request #30 from themiron/master X-Git-Tag: debian/1.1+git20160131-1~32 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=commitdiff_plain;h=8d9b60fb496000988f3633951f2e30380fc2de50;hp=29b9032cbef27bc60a20c955d607537fedd554af Merge pull request #30 from themiron/master Fix handling of DHCPv6 replies containing unrequested IA_NA/IA_PD options --- diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 1786688..6ae6f7a 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -947,6 +947,10 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, _unused const int rc, && olen > -4 + sizeof(struct dhcpv6_ia_hdr)) { struct dhcpv6_ia_hdr *ia_hdr = (void*)(&odata[-4]); + if ((na_mode == IA_MODE_NONE && otype == DHCPV6_OPT_IA_NA) || + (pd_mode == IA_MODE_NONE && otype == DHCPV6_OPT_IA_PD)) + continue; + // Test ID if (ia_hdr->iaid != htonl(1) && otype == DHCPV6_OPT_IA_NA) continue;