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")
This commit is contained in:
Kristof Provost 2022-06-30 13:34:53 +02:00
parent 7963c02c9b
commit c21cbaca2b

View File

@ -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;