Page MenuHomeFreeBSD

ng_tty: don't increment m_data
ClosedPublic

Authored by vexeduxr on Sep 23 2025, 9:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 7:58 PM
Unknown Object (File)
Fri, Oct 10, 5:18 PM
Unknown Object (File)
Fri, Oct 10, 5:18 PM
Unknown Object (File)
Fri, Oct 10, 5:17 PM
Unknown Object (File)
Fri, Oct 10, 12:04 PM
Unknown Object (File)
Thu, Sep 25, 1:00 PM
Unknown Object (File)
Thu, Sep 25, 5:10 AM
Unknown Object (File)
Thu, Sep 25, 2:56 AM
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.