Page MenuHomeFreeBSD

if_epair: delete mbuf tags
ClosedPublic

Authored by kp on Oct 26 2021, 9:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 10:29 AM
Unknown Object (File)
Wed, Apr 17, 10:29 AM
Unknown Object (File)
Wed, Apr 17, 10:29 AM
Unknown Object (File)
Wed, Apr 17, 10:29 AM
Unknown Object (File)
Wed, Apr 17, 10:29 AM
Unknown Object (File)
Wed, Apr 17, 10:07 AM
Unknown Object (File)
Mar 14 2024, 12:50 AM
Unknown Object (File)
Mar 7 2024, 7:52 PM

Details

Summary

Remove all (non-persistent) tags when we transmit a packet. Real network
interfaces do not carry any tags either, and leaving tags attached can
produce unexpected results.

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42398
Build 39286: arc lint + arc unit

Event Timeline

kp requested review of this revision.Oct 26 2021, 9:53 AM
bz added inline comments.
sys/net/if_epair.c
459

Not sure if the other review we were discussion already has this but in my working branch I also have (note: the code looks different so the surroundings are different):

...
    157                         /* Remove any CSUM_SND_TAG if there as ether_input will barf. */
    158                         if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) {
    159                                 m_snd_tag_rele(m->m_pkthdr.snd_tag);
    160                                 m->m_pkthdr.snd_tag = NULL;
    161                                 m->m_pkthdr.csum_flags &= ~CSUM_SND_TAG;
    162                         }
    163                         if_setrcvif(m, ifp);
    164                         M_SETFIB(m, ifp->if_fib);
    165                         MPASS((m->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0);
...

I don't think m_tag_delete_nonpersistent() takes send tags into account?

sys/net/if_epair.c
563

Given you do the same in epair_start_locked() can we move the call down after the if() block below to save us a tiny little work in an already pressing situation?

This revision is now accepted and ready to land.Oct 27 2021, 5:45 PM
This revision was automatically updated to reflect the committed changes.