]> source.dussan.org Git - nextcloud-server.git/commitdiff
Increase subnet matcher 26515/head
authorLukas Reschke <lukas@statuscode.ch>
Wed, 7 Apr 2021 12:07:08 +0000 (12:07 +0000)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 12 Apr 2021 10:36:26 +0000 (10:36 +0000)
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
lib/private/Security/Normalizer/IpAddress.php
tests/lib/Security/Normalizer/IpAddressTest.php

index b471c499440cb8dada13982c007c2df7fbbe88fc..9e7d84e7e3fee732f2fc412eaf08f8b879aee118 100644 (file)
@@ -92,7 +92,7 @@ class IpAddress {
        }
 
        /**
-        * 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 @@ class IpAddress {
                }
                return $this->getIPv6Subnet(
                        $this->ip,
-                       128
+                       64
                );
        }
 
index 16be71cb2253bb5ace8ababde43833a0911f90a2..044fc52b4b9c1eb2aafe923b7e2d0434c58e78a4 100644 (file)
@@ -37,11 +37,19 @@ class IpAddressTest extends TestCase {
                        ],
                        [
                                '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',
                        ],
                ];
        }