Skip to content
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

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

Open
leftshift opened this issue Jul 20, 2021 · 0 comments
Open

Comments

@leftshift
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant