Add socket_set_ipv6only.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16005 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-09-01 18:48:17 +00:00
parent 654d9acc05
commit 2016626451

View File

@@ -288,3 +288,15 @@ socket_set_reuseaddr (int sock, int val)
err (1, "setsockopt SO_REUSEADDR");
#endif
}
/*
* Set the that the `sock' should bind to only IPv6 addresses.
*/
void ROKEN_LIB_FUNCTION
socket_set_ipv6only (int sock, int val)
{
#if defined(IPV6_V6ONLY) && defined(HAVE_SETSOCKOPT)
setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&val, sizeof(val));
#endif
}