mirror of
https://github.com/abh/ntppool.git
synced 2026-04-26 03:55:52 +03:00
[GH-ISSUE #18] Make sure IPv6 addresses are stored "compressed" #15
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntppool#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @abh on GitHub (Jun 4, 2011).
Original GitHub issue: https://github.com/abh/ntppool/issues/18
We need to make sure we normalize the IPv6 addresses when the servers are added. We could either do it with two unsigned BIGINTs (and store them numerically); but the space isn't really a concern and it's convenient to have them easily readable I think; so better to keep storing them like we are now – but normalized ...
Some of the IP related CPAN modules have a "compress IPv6 address" function or method; but I haven't looked too closely at any of them (they all have terrible APIs). Net::IP::XS seemed promising.
@loewis commented on GitHub (Jun 5, 2011):
The standard approach is to use inet_pton for normalization:
gives 0:1::2