]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
DHCP6: Fix configuring the suffix to delegated prefixes (#665)
authorRoy Marples <roy@marples.name>
Mon, 22 Jun 2026 17:06:35 +0000 (18:06 +0100)
committerGitHub <noreply@github.com>
Mon, 22 Jun 2026 17:06:35 +0000 (18:06 +0100)
Depending on the delegated prefix length and the user
configured suffix length, some parts of the suffix would be lost.

Reported by NVIDIA Project Vanessa

src/ipv6.c

index 8670e30ff622bc7a0386416ee28a2aaaad532b62..ee25c40af4cb161fe5cfc8afc7d6056f351837b2 100644 (file)
@@ -590,7 +590,7 @@ ipv6_userprefix(const struct in6_addr *prefix, // prefix from router
                if (prefix_len >= 64)
                        user_high = 0;
                else
-                       user_high = user_number >> (result_len - prefix_len);
+                       user_high = user_number >> (result_len - 64);
                user_low = user_number << (128 - result_len);
        } else if (result_len == 64) {
                user_high = user_number;