Date: Thu, 3 Mar 2016 10:09:49 +0000 From: Bob Bishop <rb@gid.co.uk> To: Joe Love <joe@getsomewhere.net> Cc: freebsd-emulation@freebsd.org Subject: Re: linux(64)-compat and ipv6 setsockopt Message-ID: <25BBA52E-B402-496E-AD03-DB68468BD55D@gid.co.uk> In-Reply-To: <7B0DAB1F-3C71-4E20-BC50-8EF4541B8D91@getsomewhere.net> References: <7B0DAB1F-3C71-4E20-BC50-8EF4541B8D91@getsomewhere.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, > On 2 Mar 2016, at 23:27, Joe Love <joe@getsomewhere.net> wrote: >=20 > [=E2=80=A6]It seems that a piece of code related to setting a = particular socket option for IPv6 sockets fails under the linux compat = layer: >=20 > int ipv6only =3D 1; > setsockopt(this->fd6, IPPROTO_IPV6, IPV6_V6ONLY, &ipv6only, = sizeof(ipv6only)); >=20 > Both Steamcmd and Factorio would spit out error messages like this = (this one being from Factorio): > 1.132 Error MultiplayerManager.cpp:108: MultiplayerManager failed: = "Setsockopt failed: Protocol not available=E2=80=9D [etc] This is most likely related to the fact that linux has IP4-mapped = addressing turned on by default, ie IPv4 connexions appear at the socket = as IPv6 with v4 addresses mapped into the designated IPv6 address range = (prefix ::ffff:0:0/96). FreeBSD has this turned off by default (sysctl = net.inet6.ip6.v6only =3D 1), ie you have to set up separate sockets for = v4 and v6. The above socket option is trying to do the same thing, ie turn off = mapping so that the socket is strictly IPv6 only, and either (a) isn=E2=80= =99t implemented in the linuxulator, or (b) fails because mapping is = already turned off. Running on FreeBSD it may be safe to comment out the setsockopt(). I = have never tried the alternative of setting sysctl net.inet6.ip6.v6only = to 0 because that could break almost anything. -- Bob Bishop rb@gid.co.uk
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?25BBA52E-B402-496E-AD03-DB68468BD55D>