Page MenuHomeFreeBSD

ng_tty: don't increment m_data
ClosedPublic

Authored by vexeduxr on Sep 23 2025, 9:38 PM.
Tags
None
Referenced Files
F146783418: D52702.id162739.diff
Thu, Mar 5, 1:53 PM
F146750418: D52702.id162739.diff
Thu, Mar 5, 7:03 AM
Unknown Object (File)
Wed, Mar 4, 3:46 PM
Unknown Object (File)
Sun, Mar 1, 1:19 PM
Unknown Object (File)
Sat, Feb 21, 8:31 AM
Unknown Object (File)
Fri, Feb 20, 9:13 PM
Unknown Object (File)
Fri, Feb 20, 9:13 PM
Unknown Object (File)
Fri, Feb 20, 5:26 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 67269
Build 64152: arc lint + arc unit

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.