diff options
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 08ed49629b86..b84d7395535e 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -28,7 +28,9 @@ | |||
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | #include <linux/utsname.h> | 29 | #include <linux/utsname.h> |
30 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
31 | #include <linux/in.h> | ||
31 | #include <linux/in6.h> | 32 | #include <linux/in6.h> |
33 | #include <linux/un.h> | ||
32 | 34 | ||
33 | #include <linux/sunrpc/clnt.h> | 35 | #include <linux/sunrpc/clnt.h> |
34 | #include <linux/sunrpc/rpc_pipe_fs.h> | 36 | #include <linux/sunrpc/rpc_pipe_fs.h> |
@@ -294,6 +296,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) | |||
294 | * up a string representation of the passed-in address. | 296 | * up a string representation of the passed-in address. |
295 | */ | 297 | */ |
296 | if (args->servername == NULL) { | 298 | if (args->servername == NULL) { |
299 | struct sockaddr_un *sun = | ||
300 | (struct sockaddr_un *)args->address; | ||
297 | struct sockaddr_in *sin = | 301 | struct sockaddr_in *sin = |
298 | (struct sockaddr_in *)args->address; | 302 | (struct sockaddr_in *)args->address; |
299 | struct sockaddr_in6 *sin6 = | 303 | struct sockaddr_in6 *sin6 = |
@@ -301,6 +305,10 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) | |||
301 | 305 | ||
302 | servername[0] = '\0'; | 306 | servername[0] = '\0'; |
303 | switch (args->address->sa_family) { | 307 | switch (args->address->sa_family) { |
308 | case AF_LOCAL: | ||
309 | snprintf(servername, sizeof(servername), "%s", | ||
310 | sun->sun_path); | ||
311 | break; | ||
304 | case AF_INET: | 312 | case AF_INET: |
305 | snprintf(servername, sizeof(servername), "%pI4", | 313 | snprintf(servername, sizeof(servername), "%pI4", |
306 | &sin->sin_addr.s_addr); | 314 | &sin->sin_addr.s_addr); |