git: 8011e2cd245e - stable/13 - if_epair: also remove vlan metadata from mbufs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 18 Apr 2023 07:23:31 UTC
The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8011e2cd245e64469891a9afe23c32b3fef5e503 commit 8011e2cd245e64469891a9afe23c32b3fef5e503 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2023-04-10 11:02:55 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2023-04-18 07:23:15 +0000 if_epair: also remove vlan metadata from mbufs We already remove mbuf tags from packets transitting an if_epair, but we didn't remove vlan metadata. In certain configurations this could lead to unexpected vlan tags turning up on the rx side. PR: 270736 Reviewed by: markj MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D39482 (cherry picked from commit c69ae8419734829404bdb47d694d105c85f9835e) --- sys/net/if_epair.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 2404afe63e0a..662c601b3ad1 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -136,6 +136,8 @@ static struct epair_tasks_t epair_tasks; static void epair_clear_mbuf(struct mbuf *m) { + M_ASSERTPKTHDR(m); + /* Remove any CSUM_SND_TAG as ether_input will barf. */ if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) { m_snd_tag_rele(m->m_pkthdr.snd_tag); @@ -143,6 +145,10 @@ epair_clear_mbuf(struct mbuf *m) m->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; } + /* Clear vlan information. */ + m->m_flags &= ~M_VLANTAG; + m->m_pkthdr.ether_vtag = 0; + m_tag_delete_nonpersistent(m); }