The branch stable/13 has been updated by dchagin:

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

commit 2b5f7b77a87100fcd19fb2bfab55cea2cbe920e3
Author:     Dmitry Chagin <[email protected]>
AuthorDate: 2023-08-14 12:46:12 +0000
Commit:     Dmitry Chagin <[email protected]>
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);
                        }
                }

Reply via email to