Skip to content

Commit

Permalink
SUNRPC: use request size to initialize bio_vec in svc_udp_sendto()
Browse files Browse the repository at this point in the history
[ Upstream commit 1d9cabe ]

Use the proper size when setting up the bio_vec, as otherwise only
zero-length UDP packets will be sent.

Fixes: baabf59 ("SUNRPC: Convert svc_udp_sendto() to use the per-socket bio_vec array")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
lynxeye-dev authored and gregkh committed Feb 1, 2024
1 parent e4b7b15 commit ebb6723
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sunrpc/svcsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,12 +717,12 @@ static int svc_udp_sendto(struct svc_rqst *rqstp)
ARRAY_SIZE(rqstp->rq_bvec), xdr);

iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec,
count, 0);
count, rqstp->rq_res.len);
err = sock_sendmsg(svsk->sk_sock, &msg);
if (err == -ECONNREFUSED) {
/* ICMP error on earlier request. */
iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec,
count, 0);
count, rqstp->rq_res.len);
err = sock_sendmsg(svsk->sk_sock, &msg);
}

Expand Down

0 comments on commit ebb6723

Please sign in to comment.