Summary: | socket support for IPv4-mapped IPv6 misbehave | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | zonyitoo | ||||
Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
Status: | New --- | ||||||
Severity: | Affects Many People | CC: | ae | ||||
Priority: | --- | ||||||
Version: | 14.1-STABLE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
zonyitoo
2024-06-20 16:30:32 UTC
Created attachment 251601 [details]
test program
So, I used attached test program: % clang main.c -o test % sudo ifconfig lo0 inet 10.0.0.1/24 alias % ./test main:74: sysctlbyname(net.inet6.ip6.v6only) = 1 test:29: socket fd = 3 test:35: getsockopt(IPV6_V6ONLY) = 1 test:41: setsockopt(IPV6_V6ONLY) -> 0 test:58: connect(::ffff:10.0.0.2) -> 0 test:60: ---------- test:29: socket fd = 3 test:35: getsockopt(IPV6_V6ONLY) = 1 test:56: connect(::ffff:10.0.0.2): Invalid argument test:60: ---------- % sudo sysctl net.inet6.ip6.v6only=0 net.inet6.ip6.v6only: 1 -> 0 % ./test main:74: sysctlbyname(net.inet6.ip6.v6only) = 0 test:29: socket fd = 3 test:35: getsockopt(IPV6_V6ONLY) = 0 test:58: connect(::ffff:10.0.0.2) -> 0 test:60: ---------- test:29: socket fd = 3 test:35: getsockopt(IPV6_V6ONLY) = 0 test:41: setsockopt(IPV6_V6ONLY) -> 1 test:56: connect(::ffff:10.0.0.2): Invalid argument test:60: ---------- 1. As you can see, getsockopt() returns default value of socket option, that depends on sysctl variable. 2. Depending on V6ONLY sockopt your app can or can not connect. Probably your problem is python related. |