From: Roy Marples Date: Sat, 4 May 2019 09:19:02 +0000 (+0100) Subject: DHCPv6: Fix exclude prefix length check. X-Git-Tag: v7.2.2^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d30538898e39cc9a49ced4e67e91013d1d84a2c2;p=thirdparty%2Fdhcpcd.git DHCPv6: Fix exclude prefix length check. --- diff --git a/src/dhcp6.c b/src/dhcp6.c index 583f3b3f..7f26129f 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -2187,14 +2187,14 @@ dhcp6_findpd(struct interface *ifp, const uint8_t *iaid, continue; } + ol--; /* Check option length matches prefix length. */ if (((*o - a->prefix_len - 1) / NBBY) + 1 != ol) { logerrx("%s: PD Exclude length mismatch", ifp->name); continue; } - a->prefix_exclude_len = *o++; - ol--; + memcpy(&a->prefix_exclude, &a->prefix, sizeof(a->prefix_exclude)); nb = a->prefix_len % NBBY;