Page MenuHomeFreeBSD

if_bridge(4): ensure all traffic passing over the bridge is accounted for
ClosedPublic

Authored by kevans on Mar 17 2019, 7:39 PM.

Details

Summary

Consider a bridge0 with em0 and em1 members. Traffic rx'd by em0 and transmitted by bridge0 through em1 gets accounted for in IPACKETS/IBYTES and bridge0 bpf -- assuming it's not unicast traffic destined for em1. Unicast traffic destined for em1 traffic is not accounted for by any mechanism, and isn't pushed through bridge0's bpf machinery as any other packets that pass over the bridge do.

Fix this and simplify GRAB_OUR_PACKETS by bailing out early if it was rx'd by the interface that it was addressed for. Everything else there is relevant for any traffic that came in from one member that's being directed at another member of the bridge -- it should be visible via bpf on the bridge, it should increment IPACKETS/IBYTES because the traffic -is- flowing over the bridge, and it should go ahead and trigger on the physical interface because it's locally destined traffic.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

kevans created this revision.Mar 17 2019, 7:39 PM
kristof accepted this revision.Mar 23 2019, 12:27 PM
This revision is now accepted and ready to land.Mar 23 2019, 12:27 PM
This revision was automatically updated to reflect the committed changes.