Skip to content

Ipv4Addr::is_global() returns true for non global address #57558

Closed
@JakubOnderka

Description

@JakubOnderka

This code should be correct, because according to IANA IPv4 Special-Purpose Address Registry document, all address in 0.0.0.0/8 are not global reachable.

#![feature(ip)]
use std::net::Ipv4Addr;

fn main() {
    let ip = Ipv4Addr::new(0, 0, 0, 1);
    assert!(!ip.is_global());
}

But it panic on assertion failed in latest nightly (2019-01-11) (see Rust Playground)

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions