Page MenuHomeFreeBSD

ng_tty: don't increment m_data
ClosedPublic

Authored by vexeduxr on Sep 23 2025, 9:38 PM.
Tags
None
Referenced Files
F167280358: D52702.diff
Thu, Aug 20, 3:07 PM
Unknown Object (File)
Wed, Aug 19, 3:07 AM
Unknown Object (File)
Tue, Aug 18, 8:48 AM
Unknown Object (File)
Tue, Aug 18, 3:42 AM
Unknown Object (File)
Mon, Aug 17, 12:29 PM
Unknown Object (File)
Mon, Aug 17, 2:58 AM
Unknown Object (File)
Fri, Aug 14, 8:57 PM
Unknown Object (File)
Sat, Aug 8, 5:33 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/netgraph/ng_tty.c
488

That would also imply that the previous code was pretty boken, right? This appends to mbuf at m->m_len, but *mtod(m, u_char *) = c is effectively m_data[0] = c rather than m_data[m_len++] = c

sys/netgraph/ng_tty.c
488

Oh, I guess if it's always incrementing m_data. sorry.

sys/netgraph/ng_tty.c
488

Doing some more digging, this used to rely on setting m_data to m_pktdat before sending it off, but that seems to have been broken since 2ffded5

Thanks a lot for the fix and sorry for the breakage.

This revision is now accepted and ready to land.Sep 24 2025, 11:33 AM
This revision was automatically updated to reflect the committed changes.