git: ad51c47fb431 - main - sockbuf: fix assertion in sbcreatecontrol()

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Wed, 25 May 2022 07:19:56 UTC
The branch main has been updated by glebius:

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

commit ad51c47fb43139b49aafdde615f9e21cbc943238
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-05-25 07:19:41 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-05-25 07:19:41 +0000

    sockbuf: fix assertion in sbcreatecontrol()
    
    Fixes:  6890b588141a8298fc8a63700aeeea4ba36ca3f9
---
 sys/kern/uipc_sockbuf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c
index e3a9f92d8da0..bc0a48a37810 100644
--- a/sys/kern/uipc_sockbuf.c
+++ b/sys/kern/uipc_sockbuf.c
@@ -1771,8 +1771,8 @@ sbcreatecontrol(const void *p, u_int size, int type, int level, int wait)
 		if (CMSG_SPACE(size) > MCLBYTES)
 			return (NULL);
 	} else
-		KASSERT(size <= MCLBYTES, ("%s: passed size %u > MCLBYTES",
-		    __func__, size));
+		KASSERT(CMSG_SPACE(size) <= MCLBYTES,
+		    ("%s: passed CMSG_SPACE(%u) > MCLBYTES", __func__, size));
 
 	if (CMSG_SPACE(size) > MLEN)
 		m = m_getcl(wait, MT_CONTROL, 0);