Skip to content

Support wildcards in IPv6 address ranges #3

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

Merged
merged 2 commits into from
Jul 18, 2016
Merged

Support wildcards in IPv6 address ranges #3

merged 2 commits into from
Jul 18, 2016

Conversation

kevinoid
Copy link
Contributor

@kevinoid kevinoid commented May 23, 2016

This PR adds support for wildcard characters in IPv6 address ranges, as discussed in matomo-org/matomo#9411. The support is analogous to IPv4 where * can replace a single group of digits and must appear at the end of the address.

This implementation rejects some previously allowed but unintended (and poorly behaved) IPv4 address ranges, such as ones which included digits in the same group as a wildcard character (e.g. 192.168.1*.1*2, 192.168.1.2*) or included both wildcards and a subnet size (e.g. 192.168.*.*/24). It also requires the subnet size to be numeric. If either of these is contentious, I can rework/remove them or submit as a separate PR.

Thanks for considering,
Kevin

fix matomo-org/matomo#9411

kevinoid added 2 commits May 22, 2016 23:37
Support analogously to IPv4, '*' can replace a single group of digits
and must appear at the end of the address.

As part of the implementation, reject previously misinterpreted IPv4
addresses which included digits in the same group as a wildcard
character (e.g. `192.168.1*.1*2`, `192.168.1.2**`) or included both
wildcards and a subnet size (e.g. `192.168.*.*/24`).
@kevinoid
Copy link
Contributor Author

Note: I do not think the test failures are related to this code. They appear to be in IPTest.php for PHP 5.5, 5.6, and hhvm. PHP 5.4 has a dependency error. PHP 5.3 an OpenSSL error.

@mattab
Copy link
Member

mattab commented May 27, 2016

Thank you for the Pull request, we will try to review it for the next release 2.16.2 matomo-org/matomo#10058

@mattab mattab mentioned this pull request May 27, 2016
38 tasks
@coveralls
Copy link

coveralls commented Jul 14, 2016

Coverage Status

Coverage increased (+0.8%) to 96.0% when pulling 98942d7 on kevinoid:ipv6-wildcards into 5ab9e61 on piwik:master.

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

Successfully merging this pull request may close these issues.

Let users exclude IPv6 address ranges using * wildcard exclusion rules for IPv6 such as 2001:DB8:*:*:*:*:*:*
3 participants