Skip to content

Conversation

@joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Oct 31, 2024

Summary

Link-Local Addresses in IPv6 may contain Zone indexes/IDs (e.g. fe80::1fc4:15d8:78db:2319%enp4s0). Parsing was failing and throwing. This PR fixes that by enabling the handling in our existing IP handling library.

Docs for the library we use: https://github.com/mlocati/ip-lib?tab=readme-ov-file#accepting-ipv6-zone-ids

Wikipedia for the curious: https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses_(with_zone_index)

TODO

  • Add tests ideally

Checklist

@joshtrichards
Copy link
Member Author

/backport to stable30

@solracsf

This comment was marked as resolved.

@joshtrichards

This comment was marked as resolved.

@nickvergessen
Copy link
Member

Should add tests to all affected components:
https://github.com/nextcloud/server/blob/master/tests/lib/Security/Ip/RemoteAddressTest.php
https://github.com/nextcloud/server/blob/master/tests/lib/Net/IpAddressClassifierTest.php

@MartB
Copy link
Member

MartB commented Nov 3, 2024

Indeed, Im going to close my PR then :)

@skjnldsv skjnldsv merged commit 3c42906 into master Nov 6, 2024
177 checks passed
@skjnldsv skjnldsv deleted the jtr/fix-ipv6-zone-ids-link-local branch November 6, 2024 08:17
@skjnldsv skjnldsv mentioned this pull request Jan 7, 2025
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 bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants