From cc6154603e4fe0cfdeb1c1e046de259b73559235 Mon Sep 17 00:00:00 2001 From: Carlos de Paula Date: Thu, 9 Jan 2020 19:21:41 -0300 Subject: [PATCH] Fix for the case for kernels without CONFIG_BRIDGE_VLAN_FILTERING If the Linux kernel is not built with the parameter CONFIG_BRIDGE_VLAN_FILTERING, passing vlanFiltering in the Bridge struct returns an error creating the bridge interface. This happens even when no parameter is set on Vlan in the CNI config. This change fixes the case where no Vlan parameter is configured on CNI config file so the flag doesn't need to be included in the struct. Signed-off-by: Carlos de Paula --- plugins/main/bridge/bridge.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/main/bridge/bridge.go b/plugins/main/bridge/bridge.go index cc6bf7dd..075d29bd 100644 --- a/plugins/main/bridge/bridge.go +++ b/plugins/main/bridge/bridge.go @@ -224,7 +224,9 @@ func ensureBridge(brName string, mtu int, promiscMode, vlanFiltering bool) (*net // default packet limit TxQLen: -1, }, - VlanFiltering: &vlanFiltering, + } + if vlanFiltering { + br.VlanFiltering = &vlanFiltering } err := netlink.LinkAdd(br)