Skip to content

Trouble generating an Ipv4 Address from an Ipv4 CIDR #2

@rvbcldud

Description

@rvbcldud

I am trying to use your Rust crate to generate a Ipv4 address given an Ipv4 CIDR like so:

fn main() -> ipgen::Result<()> {
    let network = "10.0.0.0/8".parse()?;
    let addr = ip("test", network)?;

    Ok(())
}

However, I get the following error:

Error: InvalidIpNetwork("[BUG] failed to parse the generated IP address `a83:6304` as IPv4")

Looking at the source code, I don't see anything guarantees that the generated Ipv6 address can be converted back to an Ipv4 address.

Let me know how you can help, @rushmorem!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions