sin.sin_port = htons(port);
val = 1;
- if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0)
- xlog(L_ERROR, "setsockopt failed: %s\n", strerror(errno));
+ if (proto == IPPROTO_TCP)
+ if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
+ &val, sizeof(val)) < 0)
+ xlog(L_ERROR, "setsockopt failed: %s\n",
+ strerror(errno));
#if 0
/* I was told it didn't work with gigabit ethernet.
int
svcudp_socket (u_long number, int reuse)
{
- return svc_socket (number, SOCK_DGRAM, IPPROTO_UDP, reuse);
+ return svc_socket (number, SOCK_DGRAM, IPPROTO_UDP, 0);
}
#ifdef TEST