net/pear-Net_IPv6: Add patches for handling zones


net/pear-Net_IPv6: Add patches for handling zones

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")
Differential Revision: https://reviews.freebsd.org/D36151


linnemannr_gmail.comAuthored on Aug 12 2022, 11:19 AM
gargaCommitted on Aug 12 2022, 11:23 AM
Differential Revision
D36151: net/pear-Net_IPv6: Add patches for handling zones
R11:1d502c270aa3: devel/boost-python-libs: limit python 3.8-3.10 as py-numpy used yet