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

String Representations of Ipv6Net allow more than 8 groups #50

Open
shaobo-he-aws opened this issue Apr 13, 2023 · 2 comments
Open

String Representations of Ipv6Net allow more than 8 groups #50

shaobo-he-aws opened this issue Apr 13, 2023 · 2 comments

Comments

@shaobo-he-aws
Copy link

Consider the following program,

use ipnet::IpNet;
use std::net::IpAddr;

fn main() {
    assert!("ffff:ffff:ffff:ffff:ffff:ffff::ffff:ffff/114".parse::<IpNet>().is_ok());
    assert!("ffff:ffff:ffff:ffff:ffff:ffff::ffff:ffff".parse::<IpAddr>().is_ok());
}

The second assertion fails while the first one holds. ffff:ffff:ffff:ffff:ffff:ffff::ffff:ffff contains 8 ffffs and 1 :: that represents at least one all-zero groups.

@shaobo-he-aws
Copy link
Author

Hello @krisprice, could you please confirm if it's a bug? Thank you very much.

@krisprice
Copy link
Owner

Hi @shaobo-he-aws - interesting, this behavior should get corrected whenever I get around to issue #32. :)

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

2 participants