disallow setsockopt(IPV6_V6ONLY) for already bound sockets.

Obtained from:	KAME
MFC after:	10 days
This commit is contained in:
ume 2001-06-24 20:25:38 +00:00
parent e3cab8dc0c
commit 6b88781acf

View File

@ -1365,6 +1365,17 @@ do { \
break;
case IPV6_V6ONLY:
/*
* make setsockopt(IPV6_V6ONLY)
* available only prior to bind(2).
* see ipng mailing list, Jun 22 2001.
*/
if (in6p->in6p_lport ||
!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_laddr))
{
error = EINVAL;
break;
}
/*
* XXX: BINDV6ONLY should be integrated
* into V6ONLY.