Commit f4c4c4ae authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] Fix bug in svc_udp_recvfrom

 Hirokazu Takahashi <taka@valinux.co.jp> noticed that
 svc_udp_recvfrom wouild set some fields in rqstp->rq_arg
 wrongly if the request was shorter than one page.
 This patch makes the code in udp_recvfrom the same
 as the (correct) code in tcp_recvfrom.
parent c4944025
......@@ -574,8 +574,14 @@ svc_udp_recvfrom(struct svc_rqst *rqstp)
rqstp->rq_arg.len = len;
rqstp->rq_arg.page_base = 0;
if (len <= rqstp->rq_arg.head[0].iov_len) {
rqstp->rq_arg.head[0].iov_len = len;
rqstp->rq_arg.page_len = 0;
} else {
rqstp->rq_arg.page_len = len - rqstp->rq_arg.head[0].iov_len;
rqstp->rq_argused += (rqstp->rq_arg.page_len + PAGE_SIZE - 1)/ PAGE_SIZE;
}
rqstp->rq_prot = IPPROTO_UDP;
/* Get sender address */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment