Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Aug 2023 11:41:16 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2b5f7b77a871 - stable/13 - linux(4): Improve readability of recvmsg control buffer copyout code
Message-ID:  <202308211141.37LBfGh4045726@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=2b5f7b77a87100fcd19fb2bfab55cea2cbe920e3

commit 2b5f7b77a87100fcd19fb2bfab55cea2cbe920e3
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-08-14 12:46:12 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-08-21 10:39:04 +0000

    linux(4): Improve readability of recvmsg control buffer copyout code
    
    MFC after:      1 week
    
    (cherry picked from commit a21238d843ebe02e696cdc30b008382dfca5612e)
---
 sys/compat/linux/linux_socket.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index 076be5aef2c0..063e542f9d83 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -1861,10 +1861,9 @@ cont:
 		lcm->cmsg_len = LINUX_CMSG_LEN(datalen);
 		error = copyout(lcm, outbuf, L_CMSG_HDRSZ);
 		if (error == 0) {
-			outbuf += L_CMSG_HDRSZ;
-			error = copyout(data, outbuf, datalen);
+			error = copyout(data, LINUX_CMSG_DATA(outbuf), datalen);
 			if (error == 0) {
-				outbuf += LINUX_CMSG_ALIGN(datalen);
+				outbuf += LINUX_CMSG_SPACE(datalen);
 				outlen += LINUX_CMSG_SPACE(datalen);
 			}
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308211141.37LBfGh4045726>