Skip to content

Support zone id when parsing / formatting SocketAddrV6 #1992

@jannic

Description

@jannic

SocketAddrV6 contains a field scope_id (AKA zone id in RFCs).

In RFC4007, a textual representation for an IPv6 address with a zone id is specified, where the zone id is appended to the ipv6 address with % as a separator.

I think it would be very useful and quite easy to add parsing of a numeric zone id to read_socket_addr_v6.

For improved usability, adding support for interface names would be nice, but those would need to be converted to interface indices using OS specific interfaces (like libc::if_nametoindex on linux).

When formatting a SocketAddrV6, the zone id could be printed if it's not 0. (But that could be seen as an incompatible change.)

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions