diff options
author | alfred <alfred@FreeBSD.org> | 2004-07-12 06:22:42 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2004-07-12 06:22:42 +0000 |
commit | 031e087d2c3a8f23b40ec3cd62b741f935e1e2e6 (patch) | |
tree | bf496bf6af68cb9b9d21598b856b458f96bb8fab /sys/kern | |
parent | df5304b63cb13fff0de92961ba80dea84c5c552c (diff) | |
download | FreeBSD-src-031e087d2c3a8f23b40ec3cd62b741f935e1e2e6.zip FreeBSD-src-031e087d2c3a8f23b40ec3cd62b741f935e1e2e6.tar.gz |
Use SO_REUSEADDR and SO_REUSEPORT when reconnecting NFS mounts.
Tune the timeout from 5 seconds to 12 seconds.
Provide a sysctl to show how many reconnects the NFS client has done.
Seems to fix IPv6 from: kuriyama
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_socket.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index f3a0108..6787573 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1541,6 +1541,25 @@ sooptcopyin(sopt, buf, len, minlen) return 0; } +/* + * Kernel version of setsockopt(2)/ + * XXX: optlen is size_t, not socklen_t + */ +int +kern_setsockopt(struct socket *so, int level, int optname, void *optval, + size_t optlen) +{ + struct sockopt sopt; + + sopt.sopt_level = level; + sopt.sopt_name = optname; + sopt.sopt_dir = SOPT_SET; + sopt.sopt_val = optval; + sopt.sopt_valsize = optlen; + sopt.sopt_td = NULL; + return (sosetopt(so, &sopt)); +} + int sosetopt(so, sopt) struct socket *so; |