]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCPv6: Fix exclude prefix length check. v7.2.2
authorRoy Marples <roy@marples.name>
Sat, 4 May 2019 09:19:02 +0000 (10:19 +0100)
committerRoy Marples <roy@marples.name>
Sat, 4 May 2019 09:19:02 +0000 (10:19 +0100)
src/dhcp6.c

index 583f3b3f523f1d85d082dfec8f838b00cb65f861..7f26129f6d4988c7b31fd570e3f8165701990bb6 100644 (file)
@@ -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;