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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user