Skip to content

Performing moveTo with x.0.0.0 subnets fails consistently #50

Description

@MetroConductor

Problem description:
When parsing a x.0.0.0 network address, in example 240.0.0.0/4, calling Network::moveTo() causes an exception.

Steps to reproduce:

  1. Create a network using Network::parse, ie.: $network = Network::parse('240.0.0.0/4');
  2. Call moveTo with a higher prefix length, ie.: $network->moveTo(5);

Desired result:
An array with two Networks should be returned.

Actual result:
In most cases, a IpException is thrown with the following message: "Invalid IP address format"

Additional info:
This behaviour can be observed for most x.0.0.0 networks, especially with a prefix length smaller than 8. Attached you will find my test script, detailing the failings: iptools_network_test.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions