git: e05342f3618f - stable/14 - ng_tty: don't increment m_data
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 01 Oct 2025 09:38:50 UTC
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 */