Page MenuHomeFreeBSD

net/pear-Net_IPv6: Add patches for handling zones
ClosedPublic

Authored by linnemannr_gmail.com on Aug 12 2022, 4:54 AM.

Details

Summary

The upstream Net/IPv6 package from PEAR has significant bugs revolving around
handling of string presentation v6 addresses which have RFC 4007 zones. Patches
are added in this commit to address them plus a handful of other errors until an
updated version of the package becomes available with these changes included.

  • Add getZone() and removeZone() class methods
  • Alter SplitV64() to remove any zone before attempting to split an address into v6 and v4 parts. The zone has no meaning in this context
  • Alter compress to remove and restore a zone prior to restoring a prefix
  • Alter compress() to rejoin a compressed v6 part with a v4 part with a colon if the v6 part does not already end with one
  • Fix undefined variable '$address' in isCompressible()
  • Ensure no zone is present at the end of an address in _ip2Bin(). The zone is not a part of the binary address
  • Change string/int arithmetic to int/int arithmetic in _ip2Bin by mapping exploded v4 address octets to integer values
  • Fix unit tests to work in modern versions of php and phpunit
    • Align test case class name with source file name
    • Use phpunit namespaces
    • Make return type of AllTests::setUp() the expected 'void'

In addition, eight unit tests are added for basic verification of zone handling.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Aug 12 2022, 11:24 AM
This revision was automatically updated to reflect the committed changes.