Skip to content

Forward and backward conversion with arpa format for IPv6 don't match #141

@leftshift

Description

@leftshift

While working on #140 and adding a test that converts the valid ipv4 addresses to reverse arpa format and back and checks whether they match, I also tried adding the same kind of test for IPv6.

That test however failed, because reverseForm will cut some nibbles off based on the netmask.
Then, trying to convert back to an address will fail because fromArpa only accepts full-length reverse addresses.

I'm not 100% sure about the reason reverseForm will cut the address shorter in those cases, I haven't found anything about that in the respective RFCs, if you could point me to somewhere where this is used I'd be interested.

Just changing the default behaviour probably isn't possible though, since someone might rely on this behaviour.
One possibility I see is adding another option to ReverseFormOptions to set whether the netmask should be considered when generating the reverse form or the full lenth reverse form should always be generated.

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