You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write a program with cosmo to connect to ip6 link-local hosts (fe80::...).
Using link-local ip6 usually involve known the interface scope-id so I wanted to use getifaddrs
to get them, but getifaddrs only returns ipv4 interface information.
So I tried to implement it but sadly ioctl(SIOCGIFCONF) only returns AF_INET information on linux.
Linux man page says this
AF_INET6 IPv6 addresses can be read from /proc/net/if_inet6 or via rtnetlink(7)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm trying to write a program with cosmo to connect to ip6 link-local hosts (fe80::...).
Using link-local ip6 usually involve known the interface scope-id so I wanted to use
getifaddrs
to get them, but
getifaddrs
only returns ipv4 interface information.So I tried to implement it but sadly
ioctl(SIOCGIFCONF)
only returns AF_INET information on linux.Linux man page says this
Surely it is not compatible with others OSes.
Openbsd seems to returns ipv6 information with
ioctl(SIOCGIFCONF)
, see https://man.openbsd.org/netintro.4#ADDRESSINGApple has an implementation for windows https://github.com/apple-oss-distributions/mDNSResponder/blob/71e6611203d57c78b26fd505d98cb57a33d00880/mDNSWindows/mDNSWin32.c#L3534
I could also found that parses
/proc/net/if_inet6
on linux https://android.googlesource.com/platform/external/mdnsresponder/+/20faaf7/mDNSPosix/mDNSUNP.c#83What do you think would be the best approach for this problem?
Thanks,
Hugues
Beta Was this translation helpful? Give feedback.
All reactions