HomeFreeBSD

pf: call dummynet directly from the ethernet code

Description

pf: call dummynet directly from the ethernet code

Until recently dummynet in ethernet rules did not send packets directly
to dummynet but instead marked them and left the interactions with
dummynet to the layer 3 pf code.
This worked fine for incoming packets (where we process ethernet rules
before layer 3 rules), but not for outbound packets (where the order of
operations is the reverse).

Dummynet does support handling layer 2 traffic, so send the packets
directly to dummynet.

The main limitation now is that pf does not inspect layer 4 (i.e.
TCP/UDP) so we don't have protocol information or port numbers. Dummynet
potentially uses this to separate traffic flows, which will not work for
ethernet dummynet rules. However, pipes (i.e. adding latency or
restricting bandwidth) will work exactly as expected.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35257

Details

Provenance
kpAuthored on May 18 2022, 3:49 PM
Differential Revision
D35257: pf: call dummynet directly from the ethernet code
Parents
rG12c542cd0e9e: dummynet: do not store struct ifnet pointers
Branches
Unknown
Tags
Unknown