-
Notifications
You must be signed in to change notification settings - Fork 183
Ursa 21.16.0 plat 25124 - IPv6 Support #13314
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
base: Venus-22.1.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces IPv6 support by replacing outdated ip2long() calls with a new utility method (kIpAddressUtils::ipToLong) and enhancing IP range and mask handling logic. Key changes include:
- Replacing ip2long() with kIpAddressUtils::ipToLong() in multiple scripts and model files.
- Extending kIpAddressUtils to support IPv6 conversions, comparisons, and CIDR calculations.
- Adding comprehensive tests to verify IPv6 functionality across various components.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
deployment/base/scripts/DigitalElement/convertAnonymousCsvToBin.php | Updated IP conversion to use IPv6-compatible method. |
alpha/scripts/uv_summary_insert.php | Updated IP conversion for improved IPv6 support. |
alpha/scripts/analyze_collect_stats.php | Updated IP conversion to support IPv6. |
alpha/lib/model/WidgetLog.php | Updated IP conversion for IPv6 support. |
alpha/apps/kaltura/lib/requestUtils.class.php | Updated IP conversion for IPv6 support. |
alpha/apps/kaltura/lib/request/kIpAddressUtils.php | Enhanced to support IPv6 with new utility methods and logic updates. |
alpha/apps/kaltura/lib/request/ipv6Test.php | Added tests ensuring IPv6 conversion, range checking, and validations. |
alpha/apps/kaltura/lib/request/infraRequestUtils.class.php | Updated IP conversion; note a potential issue with method resolution for ipToLong. |
alpha/apps/kaltura/lib/kDigitalElementIPGeoCoder.php | Updated IP conversion for IPv6 support. |
if ($longIp && $longIp != -1) | ||
{ | ||
foreach ($privateRanges as $range) | ||
{ | ||
list($start, $end) = explode('|', $range); | ||
if ($longIp >= ip2long($start) && $longIp <= ip2long($end)) { | ||
// Replace ip2long with ipToLong to support both IPv4 and IPv6 | ||
if ($longIp >= self::ipToLong($start) && $longIp <= self::ipToLong($end)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code uses self::ipToLong() inside infraRequestUtils, but ipToLong is defined in kIpAddressUtils. Update the call to kIpAddressUtils::ipToLong() to ensure proper IPv6 support.
if ($longIp >= self::ipToLong($start) && $longIp <= self::ipToLong($end)) { | |
if ($longIp >= kIpAddressUtils::ipToLong($start) && $longIp <= kIpAddressUtils::ipToLong($end)) { |
Copilot uses AI. Check for mistakes.
No description provided.