From c21cbaca2b0db4eb6988da5c470cb520d82b17eb Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Thu, 30 Jun 2022 13:34:53 +0200 Subject: [PATCH] dummynet: handle IPV6 layer 2 traffic When pf sends layer 2 traffic into dummynet it still marks IPv6 with IPFW_ARGS_IPV6 (which dummynet translates to PROTO_V6). That in turn results in it not matching the 'DIR_IN | PROTO_LAYER2' case, and triggering the 'bad switch' error message. Add extra cases for LAYER2 | PROTO_IPV6. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/ipfw/ip_dn_io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/ipfw/ip_dn_io.c b/sys/netpfil/ipfw/ip_dn_io.c index 98f9d08495df..deeb3d9325de 100644 --- a/sys/netpfil/ipfw/ip_dn_io.c +++ b/sys/netpfil/ipfw/ip_dn_io.c @@ -804,6 +804,7 @@ dummynet_send(struct mbuf *m) break; + case DIR_IN | PROTO_LAYER2 | PROTO_IPV6: case DIR_IN | PROTO_LAYER2: /* DN_TO_ETH_DEMUX: */ /* * The Ethernet code assumes the Ethernet header is @@ -819,6 +820,7 @@ dummynet_send(struct mbuf *m) ether_demux(m->m_pkthdr.rcvif, m); break; + case DIR_OUT | PROTO_LAYER2 | PROTO_IPV6: case DIR_OUT | PROTO_LAYER2: /* DN_TO_ETH_OUT: */ ether_output_frame(ifp, m); break;