]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
netgraph/ng_bridge: Derive forwarding mode from first attached hook
authorLutz Donnerhacke <donner@FreeBSD.org>
Sat, 6 Feb 2021 10:25:04 +0000 (11:25 +0100)
committerLutz Donnerhacke <donner@FreeBSD.org>
Sat, 6 Feb 2021 14:01:15 +0000 (15:01 +0100)
commitc869d905baa4e329dfd6793e7487b5985248ddb6
tree1b3a9d610a989df670ff8983b6bd10066f7501ba
parent689561d4032233bc171cff30d6756c3cf3b22720
netgraph/ng_bridge: Derive forwarding mode from first attached hook

Handling of unknown MACs on an bridge with incomplete learning
capabilites (aka uplink ports) can be defined in different ways.

The classical approach is to broadcast unicast frames send to an
unknown MAC, because the unknown devices can be everywhere. This mode
is default for ng_bridge(4).

In the case of dedicated uplink ports, which prohibit learning of MAC
addresses in order to save memory and CPU cycles, the broadcast
approach is dangerous. All traffic to the uplink port is broadcasted
to every downlink port, too. In this case, it's better to restrict the
distribution of frames to unknown MAC to the uplink ports only.

In order to keep the chance small and the handling as natural as
possible, the first attached link is used to determine the behaviour
of the bridge: If it is an "uplink" port, then the bridge switch from
classical mode to restricted mode.

Reviewed By: kp
Approved by: kp (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28487
share/man/man4/ng_bridge.4
sys/netgraph/ng_bridge.c