[Bug 270736] if_epair(4): Unexpected double tagged ICMP requests

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 10 Apr 2023 12:39:00 UTC

Kristof Provost <kp@freebsd.org> changed:

           What    |Removed                     |Added
                 CC|                            |kp@freebsd.org
           Assignee|bugs@FreeBSD.org            |kp@freebsd.org
             Status|New                         |Open

--- Comment #1 from Kristof Provost <kp@freebsd.org> ---
That's a fun one.

It looks like the problem is actually on the receive side, in that we don't
clear the M_VLANTAG from m->m_flags and end up thinking there's an extra vlan
on the RX side.

if_epair already has some code to remove tags and such when handing a packet
over to the receive path, but it didn't clear the vlan information. (Arguably
we could also clear it on the network stack side, but this is pretty specific
to if_epair.)

I'm testing this now:

diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c
index aeed993249f5..21c0c598e8d4 100644
--- a/sys/net/if_epair.c
+++ b/sys/net/if_epair.c
@@ -140,6 +140,11 @@ epair_clear_mbuf(struct mbuf *m)
                m->m_pkthdr.csum_flags &= ~CSUM_SND_TAG;

+       /* Clear vlan information. */
+       m->m_flags &= ~M_VLANTAG;
+       if (m->m_flags & M_PKTHDR)
+               m->m_pkthdr.ether_vtag = 0;

You are receiving this mail because:
You are the assignee for the bug.