aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/svcsock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index af3198814c15..8b0832834135 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -426,13 +426,14 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
426 long all[SVC_PKTINFO_SPACE / sizeof(long)]; 426 long all[SVC_PKTINFO_SPACE / sizeof(long)];
427 } buffer; 427 } buffer;
428 struct cmsghdr *cmh = &buffer.hdr; 428 struct cmsghdr *cmh = &buffer.hdr;
429 int err, len;
430 struct msghdr msg = { 429 struct msghdr msg = {
431 .msg_name = svc_addr(rqstp), 430 .msg_name = svc_addr(rqstp),
432 .msg_control = cmh, 431 .msg_control = cmh,
433 .msg_controllen = sizeof(buffer), 432 .msg_controllen = sizeof(buffer),
434 .msg_flags = MSG_DONTWAIT, 433 .msg_flags = MSG_DONTWAIT,
435 }; 434 };
435 size_t len;
436 int err;
436 437
437 if (test_and_clear_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags)) 438 if (test_and_clear_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags))
438 /* udp sockets need large rcvbuf as all pending 439 /* udp sockets need large rcvbuf as all pending
@@ -464,8 +465,8 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)
464 return -EAGAIN; 465 return -EAGAIN;
465 } 466 }
466 len = svc_addr_len(svc_addr(rqstp)); 467 len = svc_addr_len(svc_addr(rqstp));
467 if (len < 0) 468 if (len == 0)
468 return len; 469 return -EAFNOSUPPORT;
469 rqstp->rq_addrlen = len; 470 rqstp->rq_addrlen = len;
470 if (skb->tstamp.tv64 == 0) { 471 if (skb->tstamp.tv64 == 0) {
471 skb->tstamp = ktime_get_real(); 472 skb->tstamp = ktime_get_real();