Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Oct 2025 09:38:50 GMT
From:      Ahmad Khalifa <vexeduxr@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: e05342f3618f - stable/14 - ng_tty: don't increment m_data
Message-ID:  <202510010938.5919coZf016479@gitrepo.freebsd.org>

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

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

commit e05342f3618f0e7b0e6c75a513212b389714d59a
Author:     Ahmad Khalifa <vexeduxr@FreeBSD.org>
AuthorDate: 2025-09-24 15:01:57 +0000
Commit:     Ahmad Khalifa <vexeduxr@FreeBSD.org>
CommitDate: 2025-10-01 08:34:47 +0000

    ng_tty: don't increment m_data
    
    Stop incrementing m_data so the callee can read the mbuf.
    
    MFC after:      3 days
    Reviewed by:    glebius
    Differential Revision:  https://reviews.freebsd.org/D52702
    
    (cherry picked from commit 57d5a8feda3fd25a650eaab5998db13633d62d2d)
---
 sys/netgraph/ng_tty.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c
index 6f8667c664bb..c7d8a1b64eac 100644
--- a/sys/netgraph/ng_tty.c
+++ b/sys/netgraph/ng_tty.c
@@ -485,9 +485,7 @@ ngt_rint(struct tty *tp, char c, int flags)
 	}
 
 	/* Add char to mbuf */
-	*mtod(m, u_char *) = c;
-	m->m_data++;
-	m->m_len++;
+	*(u_char *)mtodo(m, m->m_len++) = c;
 	m->m_pkthdr.len++;
 
 	/* Ship off mbuf if it's time */



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