Skip to content

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

Open
wants to merge 3 commits into
base: Venus-22.1.0
Choose a base branch
from

Conversation

danbar0kal
Copy link
Collaborator

No description provided.

@danbar0kal danbar0kal changed the base branch from Ursa-21.16.0 to Ursa-21.17.0 May 26, 2025 09:36
@danbar0kal danbar0kal changed the base branch from Ursa-21.17.0 to Ursa-21.18.0 June 9, 2025 10:51
@MosheMaorKaltura MosheMaorKaltura requested a review from Copilot June 10, 2025 07:29
Copilot

This comment was marked as outdated.

@MosheMaorKaltura MosheMaorKaltura requested a review from Copilot June 12, 2025 08:21
Copy link
Contributor

@Copilot Copilot AI left a 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)) {
Copy link
Preview

Copilot AI Jun 12, 2025

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.

Suggested change
if ($longIp >= self::ipToLong($start) && $longIp <= self::ipToLong($end)) {
if ($longIp >= kIpAddressUtils::ipToLong($start) && $longIp <= kIpAddressUtils::ipToLong($end)) {

Copilot uses AI. Check for mistakes.

@danbar0kal danbar0kal changed the base branch from Ursa-21.18.0 to Ursa-21.19.0 June 23, 2025 09:25
@danbar0kal danbar0kal changed the base branch from Ursa-21.19.0 to Venus-22.0.0 July 21, 2025 09:35
@danbar0kal danbar0kal changed the base branch from Venus-22.0.0 to Venus-22.1.0 August 5, 2025 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant