{
int i, r, err;
+ if (level == SOL_SOCKET && option_name == SO_REUSEADDR)
+ {
+ i = 1; /* Binds to TIME_WAIT sockets never cause errors */
+ getsockopt_copy(&i, sizeof(i), option_value, option_len);
+ return 0;
+ }
if (level == SOL_SOCKET && option_name == SO_KEEPALIVE)
{
i = 1; /* Keepalive is always on */
{
int i;
+ if (level == SOL_SOCKET && option_name == SO_REUSEADDR)
+ {
+ if (option_len != sizeof(i))
+ {
+ errno= EINVAL;
+ return -1;
+ }
+ i= *(int *)option_value;
+ if (!i)
+ {
+ /* At the moment there is no way to turn off
+ * reusing addresses.
+ */
+ errno= ENOSYS;
+ return -1;
+ }
+ return 0;
+ }
if (level == SOL_SOCKET && option_name == SO_KEEPALIVE)
{
if (option_len != sizeof(i))