mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
NFS: Enable NFSv4 callback server to listen on AF_INET6 sockets
Allow the NFS callback server to listen for requests via an AF_INET6 or AF_INET socket when IPv6 support is present in the kernel. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
2e532d68a2
commit
18de973530
1 changed files with 15 additions and 4 deletions
|
@ -40,6 +40,16 @@ unsigned short nfs_callback_tcpport;
|
|||
static const int nfs_set_port_min = 0;
|
||||
static const int nfs_set_port_max = 65535;
|
||||
|
||||
/*
|
||||
* If the kernel has IPv6 support available, always listen for
|
||||
* both AF_INET and AF_INET6 requests.
|
||||
*/
|
||||
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
|
||||
static const sa_family_t nfs_callback_family = AF_INET6;
|
||||
#else
|
||||
static const sa_family_t nfs_callback_family = AF_INET;
|
||||
#endif
|
||||
|
||||
static int param_set_port(const char *val, struct kernel_param *kp)
|
||||
{
|
||||
char *endp;
|
||||
|
@ -106,7 +116,7 @@ int nfs_callback_up(void)
|
|||
if (nfs_callback_info.users++ || nfs_callback_info.task != NULL)
|
||||
goto out;
|
||||
serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE,
|
||||
AF_INET, NULL);
|
||||
nfs_callback_family, NULL);
|
||||
ret = -ENOMEM;
|
||||
if (!serv)
|
||||
goto out_err;
|
||||
|
@ -116,7 +126,8 @@ int nfs_callback_up(void)
|
|||
if (ret <= 0)
|
||||
goto out_err;
|
||||
nfs_callback_tcpport = ret;
|
||||
dprintk("Callback port = 0x%x\n", nfs_callback_tcpport);
|
||||
dprintk("NFS: Callback listener port = %u (af %u)\n",
|
||||
nfs_callback_tcpport, nfs_callback_family);
|
||||
|
||||
nfs_callback_info.rqst = svc_prepare_thread(serv, &serv->sv_pools[0]);
|
||||
if (IS_ERR(nfs_callback_info.rqst)) {
|
||||
|
@ -149,8 +160,8 @@ out:
|
|||
mutex_unlock(&nfs_callback_mutex);
|
||||
return ret;
|
||||
out_err:
|
||||
dprintk("Couldn't create callback socket or server thread; err = %d\n",
|
||||
ret);
|
||||
dprintk("NFS: Couldn't create callback socket or server thread; "
|
||||
"err = %d\n", ret);
|
||||
nfs_callback_info.users--;
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue