git: fd7edfcdc3c3 - main - bridge: fix lookup for untagged packets in bridge_transmit()

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Thu, 01 Jun 2023 09:39:40 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=fd7edfcdc3c329cdbd3f5e7a554f7153e805ab04

commit fd7edfcdc3c329cdbd3f5e7a554f7153e805ab04
Author:     Ben Wilber <ben@desync.com>
AuthorDate: 2023-06-01 09:29:36 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2023-06-01 09:31:59 +0000

    bridge: fix lookup for untagged packets in bridge_transmit()
    
    b0e38a1373 improved if_bridge's ability to cope with different VLANs,
    but it failed to update bridge_transmit() to cope with the new rule that
    untagged packets are treated as having VLAN ID 0 (rather than 1, as used
    to be the case).
    
    Fix that oversight.
    
    PR:             270559
    Reviewed by:    kp
---
 sys/net/if_bridge.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 9fe915d31283..204fd3892c1f 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -2276,7 +2276,8 @@ bridge_transmit(struct ifnet *ifp, struct mbuf *m)
 	eh = mtod(m, struct ether_header *);
 
 	if (((m->m_flags & (M_BCAST|M_MCAST)) == 0) &&
-	    (dst_if = bridge_rtlookup(sc, eh->ether_dhost, 1)) != NULL) {
+	    (dst_if = bridge_rtlookup(sc, eh->ether_dhost, DOT1Q_VID_NULL)) !=
+	    NULL) {
 		error = bridge_enqueue(sc, dst_if, m);
 	} else
 		bridge_broadcast(sc, ifp, m, 0);