diff --git a/lib/private/Security/Normalizer/IpAddress.php b/lib/private/Security/Normalizer/IpAddress.php index b471c499440cb..9e7d84e7e3fee 100644 --- a/lib/private/Security/Normalizer/IpAddress.php +++ b/lib/private/Security/Normalizer/IpAddress.php @@ -92,7 +92,7 @@ private function getIPv6Subnet(string $ip, int $maskBits = 48): string { } /** - * Gets either the /32 (IPv4) or the /128 (IPv6) subnet of an IP address + * Gets either the /32 (IPv4) or the /64 (IPv6) subnet of an IP address * * @return string */ @@ -105,7 +105,7 @@ public function getSubnet(): string { } return $this->getIPv6Subnet( $this->ip, - 128 + 64 ); } diff --git a/tests/lib/Security/Normalizer/IpAddressTest.php b/tests/lib/Security/Normalizer/IpAddressTest.php index 16be71cb2253b..044fc52b4b9c1 100644 --- a/tests/lib/Security/Normalizer/IpAddressTest.php +++ b/tests/lib/Security/Normalizer/IpAddressTest.php @@ -37,11 +37,19 @@ public function subnetDataProvider() { ], [ '2001:0db8:85a3:0000:0000:8a2e:0370:7334', - '2001:db8:85a3::8a2e:370:7334/128', + '2001:db8:85a3::/64', + ], + [ + '2001:db8:3333:4444:5555:6666:7777:8888', + '2001:db8:3333:4444::/64', + ], + [ + '::1234:5678', + '::/64', ], [ '[::1]', - '::1/128', + '::/64', ], ]; }