git: e73cc0abe140 - stable/15 - ng_tty: don't increment m_data
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 01 Oct 2025 09:38:57 UTC
The branch stable/15 has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=e73cc0abe1401ff12efffa09d96d3a212608f08a commit e73cc0abe1401ff12efffa09d96d3a212608f08a Author: Ahmad Khalifa <vexeduxr@FreeBSD.org> AuthorDate: 2025-09-24 15:01:57 +0000 Commit: Ahmad Khalifa <vexeduxr@FreeBSD.org> CommitDate: 2025-10-01 09:37:35 +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 */