Skip to content

Conversation

@Altahrim
Copy link
Collaborator

@Altahrim Altahrim commented Apr 16, 2025

Summary

Allows to configure subnet size for IPv6 normalization and use smaller default.

Checklist

@Altahrim Altahrim self-assigned this Apr 16, 2025
@Altahrim Altahrim requested a review from a team as a code owner April 16, 2025 14:11
@Altahrim Altahrim requested review from artonge, nfebe and provokateurin and removed request for a team April 16, 2025 14:11
@Altahrim Altahrim added this to the Nextcloud 32 milestone Apr 16, 2025
@Altahrim Altahrim added the 3. to review Waiting for reviews label Apr 16, 2025
@Altahrim Altahrim force-pushed the feat/add-configurable-ipv6-subnet branch from 2e0995d to 446d04e Compare April 16, 2025 14:15
@Altahrim Altahrim force-pushed the feat/add-configurable-ipv6-subnet branch 2 times, most recently from be45f79 to 4276176 Compare April 16, 2025 14:27
@Altahrim
Copy link
Collaborator Author

/backport to stable31

@Altahrim
Copy link
Collaborator Author

/backport to stable30

@Altahrim
Copy link
Collaborator Author

/backport to stable29

Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just the comment needs adjustment

Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
@Altahrim Altahrim force-pushed the feat/add-configurable-ipv6-subnet branch from 4276176 to 9f666c2 Compare April 17, 2025 06:12
@come-nc
Copy link
Contributor

come-nc commented Apr 22, 2025

This broke on 32bit: https://github.com/nextcloud/server/actions/runs/14584944718/job/40908705961

There were 4 errors:

1) Test\Security\Normalizer\IpAddressTest::testGetSubnet with data set #5 ('2001:0db8:0000:0000:0000:8a2e...0:7334', '2001:db8::/56')
ValueError: 64-bit format codes are not available for 32-bit versions of PHP

/__w/server/server/lib/private/Security/Normalizer/IpAddress.php:44
/__w/server/server/lib/private/Security/Normalizer/IpAddress.php:85
/__w/server/server/tests/lib/Security/Normalizer/IpAddressTest.php:64

2) Test\Security\Normalizer\IpAddressTest::testGetSubnet with data set #6 ('2001:db8:3333:4444:5555:6666:7777:8888', '2001:db8:3333:4400::/56')
ValueError: 64-bit format codes are not available for 32-bit versions of PHP

/__w/server/server/lib/private/Security/Normalizer/IpAddress.php:44
/__w/server/server/lib/private/Security/Normalizer/IpAddress.php:85
/__w/server/server/tests/lib/Security/Normalizer/IpAddressTest.php:64

3) Test\Security\Normalizer\IpAddressTest::testGetSubnet with data set #7 ('::1234:5678', '::/56')
ValueError: 64-bit format codes are not available for 32-bit versions of PHP

/__w/server/server/lib/private/Security/Normalizer/IpAddress.php:44
/__w/server/server/lib/private/Security/Normalizer/IpAddress.php:85
/__w/server/server/tests/lib/Security/Normalizer/IpAddressTest.php:64

4) Test\Security\Normalizer\IpAddressTest::testGetSubnet with data set #8 ('[::1]', '::/56')
ValueError: 64-bit format codes are not available for 32-bit versions of PHP

/__w/server/server/lib/private/Security/Normalizer/IpAddress.php:44
/__w/server/server/lib/private/Security/Normalizer/IpAddress.php:85
/__w/server/server/tests/lib/Security/Normalizer/IpAddressTest.php:64

I suppose those tests can simply be skipped on 32bits?
@Altahrim

@susnux
Copy link
Contributor

susnux commented Apr 23, 2025

Fix in #52392

P cannot be used on 32bit you need to use VV (possible as we set it to 0 anyways).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants