diff options
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index bd31208bbb61..d86bb673e1f6 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -254,8 +254,6 @@ EXPORT_SYMBOL_GPL(svc_create_xprt); | |||
254 | */ | 254 | */ |
255 | void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt) | 255 | void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt) |
256 | { | 256 | { |
257 | struct sockaddr *sin; | ||
258 | |||
259 | memcpy(&rqstp->rq_addr, &xprt->xpt_remote, xprt->xpt_remotelen); | 257 | memcpy(&rqstp->rq_addr, &xprt->xpt_remote, xprt->xpt_remotelen); |
260 | rqstp->rq_addrlen = xprt->xpt_remotelen; | 258 | rqstp->rq_addrlen = xprt->xpt_remotelen; |
261 | 259 | ||
@@ -263,15 +261,8 @@ void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt) | |||
263 | * Destination address in request is needed for binding the | 261 | * Destination address in request is needed for binding the |
264 | * source address in RPC replies/callbacks later. | 262 | * source address in RPC replies/callbacks later. |
265 | */ | 263 | */ |
266 | sin = (struct sockaddr *)&xprt->xpt_local; | 264 | memcpy(&rqstp->rq_daddr, &xprt->xpt_local, xprt->xpt_locallen); |
267 | switch (sin->sa_family) { | 265 | rqstp->rq_daddrlen = xprt->xpt_locallen; |
268 | case AF_INET: | ||
269 | rqstp->rq_daddr.addr = ((struct sockaddr_in *)sin)->sin_addr; | ||
270 | break; | ||
271 | case AF_INET6: | ||
272 | rqstp->rq_daddr.addr6 = ((struct sockaddr_in6 *)sin)->sin6_addr; | ||
273 | break; | ||
274 | } | ||
275 | } | 266 | } |
276 | EXPORT_SYMBOL_GPL(svc_xprt_copy_addrs); | 267 | EXPORT_SYMBOL_GPL(svc_xprt_copy_addrs); |
277 | 268 | ||