aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svcsock.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 1f97ed49fee2..a98be09768a0 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -569,21 +569,13 @@ static int
569svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen) 569svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen)
570{ 570{
571 struct svc_sock *svsk = rqstp->rq_sock; 571 struct svc_sock *svsk = rqstp->rq_sock;
572 struct msghdr msg; 572 struct msghdr msg = {
573 struct socket *sock; 573 .msg_flags = MSG_DONTWAIT,
574 int len; 574 };
575 575 int len;
576 rqstp->rq_addrlen = sizeof(rqstp->rq_addr);
577 sock = svsk->sk_sock;
578
579 msg.msg_name = &rqstp->rq_addr;
580 msg.msg_namelen = sizeof(rqstp->rq_addr);
581 msg.msg_control = NULL;
582 msg.msg_controllen = 0;
583
584 msg.msg_flags = MSG_DONTWAIT;
585 576
586 len = kernel_recvmsg(sock, &msg, iov, nr, buflen, MSG_DONTWAIT); 577 len = kernel_recvmsg(svsk->sk_sock, &msg, iov, nr, buflen,
578 msg.msg_flags);
587 579
588 /* sock_recvmsg doesn't fill in the name/namelen, so we must.. 580 /* sock_recvmsg doesn't fill in the name/namelen, so we must..
589 */ 581 */
@@ -591,7 +583,7 @@ svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen)
591 rqstp->rq_addrlen = svsk->sk_remotelen; 583 rqstp->rq_addrlen = svsk->sk_remotelen;
592 584
593 dprintk("svc: socket %p recvfrom(%p, %Zu) = %d\n", 585 dprintk("svc: socket %p recvfrom(%p, %Zu) = %d\n",
594 rqstp->rq_sock, iov[0].iov_base, iov[0].iov_len, len); 586 svsk, iov[0].iov_base, iov[0].iov_len, len);
595 587
596 return len; 588 return len;
597} 589}