TcpListnener on ipv6
#1029
-
I'm trying to start a server on my link-local ip address but I'm getting Error 22 (EINVAL) when starting the server:
The same setup for ipv4 works fine. And listening to 0,0,0... on ipv6 works as well. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Answered by
Coi-l
May 13, 2025
Replies: 1 comment
-
I solved it. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Coi-l
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I solved it.
When opening a link local address you have to specify a scope_id corresponding to the networks interface.
You can use SocketAddr::V6(SocketAddrV6::new(...)) to be able to specify it.