Merge pull request #742 from lx1036/patch-1

bridge: update vlanFiltering variable to make code more readable
This commit is contained in:
Dan Williams 2022-07-28 09:13:29 -05:00 committed by GitHub
commit 8c3664b2b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -386,10 +386,7 @@ func calcGatewayIP(ipn *net.IPNet) net.IP {
}
func setupBridge(n *NetConf) (*netlink.Bridge, *current.Interface, error) {
vlanFiltering := false
if n.Vlan != 0 {
vlanFiltering = true
}
vlanFiltering := n.Vlan != 0
// create bridge if necessary
br, err := ensureBridge(n.BrName, n.MTU, n.PromiscMode, vlanFiltering)
if err != nil {