-
Notifications
You must be signed in to change notification settings - Fork 964
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
feat(quic): Add support for ip6zone in quic transport #5609
base: master
Are you sure you want to change the base?
Conversation
Hey! Thanks for the PR. Correct me if I am wrong but I dont believe this is apart of the quic spec. Might be something worth doing discussing over in https://github.com/libp2p/specs if its not apart of the spec already (will check myself here shortly). |
You're absolutely right, I hadn't noticed this. I have submitted an issue about this over at the specs repo: libp2p/specs#634 |
Changing this PR to a draft until it is determined upstream. |
#[cfg(not(unix))] | ||
fn if_nametoindex(name: impl Into<Vec<u8>>) -> io::Result<u32> { | ||
Err(io::Error::new( | ||
io::ErrorKind::Other, | ||
"if_nametoindex is not supported on this platform", | ||
)) | ||
} | ||
|
||
#[cfg(not(unix))] | ||
fn if_indextoname(name: u32) -> io::Result<String> { | ||
Err(io::Error::new( | ||
io::ErrorKind::Other, | ||
"if_indextoname is not supported on this platform", | ||
)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows support should be possible
Description
Add support for ip6zone in the quic transport
The quic transport now correctly sets the scope_id of socket addresses
converted from multiaddrs containing both the ip6 and ip6zone protocols.
On Unix systems, if the zone string is not an integer, it is converted
into an interface index using the if_nametoindex function. Otherwise, it
is parsed directly as an interface index. This interface index will then
be used as the scope_id for the socket address. When converting a socket
address back to a multiaddr, the scope_id will be included in the
ip6zone protocol, if it is not 0.
Related #5608
Notes & open questions
Change checklist