1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-27 11:55:06 +00:00

Unconditionally call the setsockopt for IPV6_V6ONLY for v6 linux sockets

no matter whether we are compiled as module or if our default of the
net.inet6.ip6.v6only sysctl already matches what we would set.

This avoids unnecessary complications with modules, VIMAGES, INET6 and
the sysctl value, especially considering that most users will use
linux compat as a module.

Discussed with:	kib, rwatson (weeks ago)
Reviewed by:	rwatson
MFC after:	6 weeks
This commit is contained in:
Bjoern A. Zeeb 2009-10-25 09:58:56 +00:00
parent f91c218bf8
commit d97bee3e7e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=198467

View File

@ -639,19 +639,12 @@ linux_socket(struct thread *td, struct linux_socket_args *args)
}
#ifdef INET6
/*
* Linux AF_INET6 socket has IPV6_V6ONLY setsockopt set to 0 by
* default and some apps depend on this. So, set V6ONLY to 0
* for Linux apps if the sysctl value is set to 1.
* Linux AF_INET6 socket has IPV6_V6ONLY setsockopt set to 0 by default
* and some apps depend on this. So, set V6ONLY to 0 for Linux apps.
* For simplicity we do this unconditionally of the net.inet6.ip6.v6only
* sysctl value.
*/
if (bsd_args.domain == PF_INET6
#ifndef KLD_MODULE
/*
* XXX: Avoid undefined symbol error with an IPv4 only
* kernel.
*/
&& V_ip6_v6only
#endif
) {
if (bsd_args.domain == PF_INET6) {
int v6only;
v6only = 0;