Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allow 1:2:3:4:5:6:7:8::9 as an IPv6 address #3

Merged
merged 1 commit into from Apr 28, 2013
Merged

Do not allow 1:2:3:4:5:6:7:8::9 as an IPv6 address #3

merged 1 commit into from Apr 28, 2013

Conversation

phil-davis
Copy link
Contributor

checkIPv6 returns "true" for addresses like:
1::2:3:4:5:6:7:8:9
1:2::3:4:5:6:7:8:9
...
1:2:3:4:5:6:7::8:9
1:2:3:4:5:6:7:8::9
these also emit the message:
Warning: str_repeat(): Second argument has to be greater than or equal to 0 in /etc/inc/IPv6.inc (or whatever file this code is in)
It is fixed by making uncompress() always insert at least one ":0:" for any "::" in the address - a "::" always implies at least ":0:". This removes the str_repeat() warning, and means that the uncompressed IPv6 address has >8 numbers in it, so it fails the later validity check, because does not have exactly 8 hex numbers.

checkIPv6 returns "true" for addresses like:
1::2:3:4:5:6:7:8:9
1:2::3:4:5:6:7:8:9
...
1:2:3:4:5:6:7::8:9
1:2:3:4:5:6:7:8::9
these also emit the message:
Warning: str_repeat(): Second argument has to be greater than or equal to 0 in /etc/inc/IPv6.inc
It is fixed by making uncompress() always insert at least one ":0:" for any "::" in the address - a "::" always implies at least ":0:". This removes the str_repeat() warning, and means that the uncompressed IPv6 address has >8 numbers in it, so it fails the later validity check, because does not have exactly 8 hex numbers.
CloCkWeRX added a commit that referenced this pull request Apr 28, 2013
Do not allow 1:2:3:4:5:6:7:8::9 as an IPv6 address
@CloCkWeRX CloCkWeRX merged commit 0992bc3 into pear:trunk Apr 28, 2013
@CloCkWeRX
Copy link
Member

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants