hyperium / hyper

An HTTP library for Rust
https://hyper.rs
MIT License
14.42k stars 1.59k forks source link

Link-local ipv6 addresses are unusable on non-Linux-like platforms #3672

Open e-dant opened 4 months ago

e-dant commented 4 months ago

Version All

Platform All platforms except Linux-like ones; Android, Linux, and Fuschia.

Description IPv6 requires scope ids. These are closely related to interfaces. Mostly synonymous.

The API for setting the interface for a connection, set_interface is unavailable on some platforms.

This makes link-local ipv6 addresses almost unusable on those platforms.

e-dant commented 4 months ago

Apologies beforehand -- I haven't included a code sample because the top-level issue is a crate up in my dependency tree (so I didn't have one handy at the time or writing.)

(That crate, reqwest, is bound to hyper's API here.)

e-dant commented 3 months ago

FWIW One way to do this on non-Linux platforms is with the IP_BOUND_IF (and v6 variant) with whatever the index, from if_nametoindex, happens to be. (Scope ids seem to be practically the same thing as interface indices in this context.)