-
Notifications
You must be signed in to change notification settings - Fork 13.3k
zone_id is required for link-local ipv6 addresses #15688
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
Comments
Could you give an example of how one might do this in C? |
As in, I've never heard of this before, so I'm keen to learn what we need to do to make up for this! |
I just learned of this also. |
From the Linux ipv6 man page: struct sockaddr_in6 {
sa_family_t sin6_family; /* AF_INET6 */
in_port_t sin6_port; /* port number */
uint32_t sin6_flowinfo; /* IPv6 flow information */
struct in6_addr sin6_addr; /* IPv6 address */
uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */
}; At the moment Rust has Despite the fact that the scope ID is part of the 'socket address' struct in C, it makes more sense to bundle it with the struct/class used to represent IPv6 addresses in my opinion -- link-local IPv6 addresses are totally meaningless without it and the value of the scope ID can be safely ignored for all other address classes. As a point of reference this is what Boost does. Something like this:
Just to clarify, the scope ID is just used to indicate which interface of the local machine a link-local address is valid for and is never transmitted on the wire. |
Nowadays, we have
and
So, this would seem to be resolved. |
…ge, r=Veykril Make rustc_layout_scalar_valid_range attributes work for non-decimal literals Closes rust-lang/rust-analyzer#15687
There is currently no way to specify a zone id (enp7s0 in this case)
Example:
Error:
http://en.wikipedia.org/wiki/IPv6_address#Link-local_addresses_and_zone_indices
The text was updated successfully, but these errors were encountered: