if_bridge(4)/bpf on incoming packets

Kyle Evans kevans at freebsd.org
Sun Mar 17 04:17:36 UTC 2019


Hi,

Given a setup like:

ifconfig bridge0 create
ifconfig bridge0 addm em0 addm wlan0 up

Packets coming in on em0 that get routed to wlan0 by the bridge will
not be passed over to wlan0's bpf(4). I have an open review [0] that
proposes changing this so that if we're passing traffic over a bridge,
it gets exposed to the destination interface's bpf interface assuming
it's not the interface that just injected it into the bridge.

I don't know the history here, though- is there any particular reason
bridge doesn't/shouldn't do this now, or is it just that it's not
useful by conventional (read: almost all) usage of a bridge?

My motivation is that in a particular testing setup I am playing with,
either em0 or bridge0 get a DHCP address and wlan0 (actually not wlan0
in my testing setup, but keeping with the above example for
convenience) also needs to pull a DHCP address from the em0 side of
the bridge for... reasons. =) I also anticipate needing to actually
monitor traffic received from the bridge by wlan0 along with traffic
received on wlan0, rather than monitoring the bridge, so the above
change makes this most convenient.

Thanks,

Kyle Evans

[0] https://reviews.freebsd.org/D19586


More information about the freebsd-net mailing list