nix icon indicating copy to clipboard operation
nix copied to clipboard

Add an `any` constructor to Ipv6Addr

Open simias opened this issue 5 years ago • 4 comments
trafficstars

This mirrors the behaviour of Ipv4Addr::any() but for IPV6 addresses.

Unless I missed something, libc doesn't export anything resembling INADDR_ANY for IPV6, so the zeroes are hardcoded. I can't imagine that this would ever cause issues however.

simias avatar Oct 20 '20 14:10 simias

The error appears to be unrelated to the change.

simias avatar Oct 20 '20 15:10 simias

In C, this is called IN6ADDR_ANY_INIT. You could try adding that to libc.

asomers avatar Oct 22 '20 00:10 asomers

Well there are two initializers in C since IPV6 uses structs instead of a 32bit int, there's the IN6ADDR_ANY_INIT macro and the in6_addr_any global. I suspected that not having them in the libc crate was intentional since they're not very useful in Rust but maybe I'm wrong. I'll open an issue in the libc repo to ask what they think.

simias avatar Oct 22 '20 12:10 simias

I opened an issue in the libc crate: https://github.com/rust-lang/libc/issues/1950

simias avatar Oct 22 '20 12:10 simias