aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/callback.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/callback.c')
-rw-r--r--fs/nfs/callback.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index 6a09760c5960..c2e9cfd9e5a4 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -40,6 +40,16 @@ unsigned short nfs_callback_tcpport;
40static const int nfs_set_port_min = 0; 40static const int nfs_set_port_min = 0;
41static const int nfs_set_port_max = 65535; 41static const int nfs_set_port_max = 65535;
42 42
43/*
44 * If the kernel has IPv6 support available, always listen for
45 * both AF_INET and AF_INET6 requests.
46 */
47#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
48static const sa_family_t nfs_callback_family = AF_INET6;
49#else
50static const sa_family_t nfs_callback_family = AF_INET;
51#endif
52
43static int param_set_port(const char *val, struct kernel_param *kp) 53static int param_set_port(const char *val, struct kernel_param *kp)
44{ 54{
45 char *endp; 55 char *endp;
@@ -106,7 +116,7 @@ int nfs_callback_up(void)
106 if (nfs_callback_info.users++ || nfs_callback_info.task != NULL) 116 if (nfs_callback_info.users++ || nfs_callback_info.task != NULL)
107 goto out; 117 goto out;
108 serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE, 118 serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE,
109 AF_INET, NULL); 119 nfs_callback_family, NULL);
110 ret = -ENOMEM; 120 ret = -ENOMEM;
111 if (!serv) 121 if (!serv)
112 goto out_err; 122 goto out_err;
@@ -116,7 +126,8 @@ int nfs_callback_up(void)
116 if (ret <= 0) 126 if (ret <= 0)
117 goto out_err; 127 goto out_err;
118 nfs_callback_tcpport = ret; 128 nfs_callback_tcpport = ret;
119 dprintk("Callback port = 0x%x\n", nfs_callback_tcpport); 129 dprintk("NFS: Callback listener port = %u (af %u)\n",
130 nfs_callback_tcpport, nfs_callback_family);
120 131
121 nfs_callback_info.rqst = svc_prepare_thread(serv, &serv->sv_pools[0]); 132 nfs_callback_info.rqst = svc_prepare_thread(serv, &serv->sv_pools[0]);
122 if (IS_ERR(nfs_callback_info.rqst)) { 133 if (IS_ERR(nfs_callback_info.rqst)) {
@@ -149,8 +160,8 @@ out:
149 mutex_unlock(&nfs_callback_mutex); 160 mutex_unlock(&nfs_callback_mutex);
150 return ret; 161 return ret;
151out_err: 162out_err:
152 dprintk("Couldn't create callback socket or server thread; err = %d\n", 163 dprintk("NFS: Couldn't create callback socket or server thread; "
153 ret); 164 "err = %d\n", ret);
154 nfs_callback_info.users--; 165 nfs_callback_info.users--;
155 goto out; 166 goto out;
156} 167}