Page MenuHomeFreeBSD

if_epair: delete mbuf tags
ClosedPublic

Authored by kp on Oct 26 2021, 9:53 AM.

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
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

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
562

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.