Skip to content
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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Zollerboy1
Copy link

@Zollerboy1 Zollerboy1 commented Sep 23, 2024

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

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@dariusc93
Copy link
Member

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).

@Zollerboy1
Copy link
Author

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

@dariusc93
Copy link
Member

Changing this PR to a draft until it is determined upstream.

@dariusc93 dariusc93 marked this pull request as draft September 25, 2024 11:26
Comment on lines +801 to 815
#[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",
))
}
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants