diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-12-11 17:56:59 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-01-06 11:53:56 -0500 |
commit | b064ec038a6180b13e5f89b6a30b42cb5ce8febc (patch) | |
tree | 942e1e6ff64868a4cd72df5d2bb8724963cc2de3 /fs | |
parent | 57ef692588bc225853ca3267ca5b7cea2b07e058 (diff) |
lockd: Enable NLM use of AF_INET6
If the kernel is configured to support IPv6 and the RPC server can register
services via rpcbindv4, we are all set to enable IPv6 support for lockd.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Aime Le Rouzic <aime.le-rouzic@bull.net>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/lockd/svc.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index 7ac7d72e3b5f..3e5f9f079110 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c | |||
@@ -53,6 +53,17 @@ static struct svc_rqst *nlmsvc_rqst; | |||
53 | unsigned long nlmsvc_timeout; | 53 | unsigned long nlmsvc_timeout; |
54 | 54 | ||
55 | /* | 55 | /* |
56 | * If the kernel has IPv6 support available, always listen for | ||
57 | * both AF_INET and AF_INET6 requests. | ||
58 | */ | ||
59 | #if (defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) && \ | ||
60 | defined(CONFIG_SUNRPC_REGISTER_V4) | ||
61 | static const sa_family_t nlmsvc_family = AF_INET6; | ||
62 | #else /* (CONFIG_IPV6 || CONFIG_IPV6_MODULE) && CONFIG_SUNRPC_REGISTER_V4 */ | ||
63 | static const sa_family_t nlmsvc_family = AF_INET; | ||
64 | #endif /* (CONFIG_IPV6 || CONFIG_IPV6_MODULE) && CONFIG_SUNRPC_REGISTER_V4 */ | ||
65 | |||
66 | /* | ||
56 | * These can be set at insmod time (useful for NFS as root filesystem), | 67 | * These can be set at insmod time (useful for NFS as root filesystem), |
57 | * and also changed through the sysctl interface. -- Jamie Lokier, Aug 2003 | 68 | * and also changed through the sysctl interface. -- Jamie Lokier, Aug 2003 |
58 | */ | 69 | */ |
@@ -256,7 +267,7 @@ int lockd_up(void) | |||
256 | "lockd_up: no pid, %d users??\n", nlmsvc_users); | 267 | "lockd_up: no pid, %d users??\n", nlmsvc_users); |
257 | 268 | ||
258 | error = -ENOMEM; | 269 | error = -ENOMEM; |
259 | serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, AF_INET, NULL); | 270 | serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, nlmsvc_family, NULL); |
260 | if (!serv) { | 271 | if (!serv) { |
261 | printk(KERN_WARNING "lockd_up: create service failed\n"); | 272 | printk(KERN_WARNING "lockd_up: create service failed\n"); |
262 | goto out; | 273 | goto out; |