1
0
mirror of https://github.com/rancher/os.git synced 2025-08-01 23:17:50 +00:00

Merge pull request #2346 from bensallen/skip_mac_match_vlans

Skip VLAN interfaces for MAC address matching in netconf.findMatch
This commit is contained in:
niusmallnan 2018-05-18 10:45:48 +08:00 committed by GitHub
commit 7e64d3e9dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,8 +114,8 @@ func findMatch(link netlink.Link, netCfg *NetworkConfig) (InterfaceConfig, bool)
continue
}
// Don't match mac address of the bond because it is the same as the slave
if bytes.Compare(haAddr, link.Attrs().HardwareAddr) == 0 && link.Attrs().Name != netConf.Bond {
// Don't match mac address of a bond or VLAN interface because it is the same address as the slave or parent.
if bytes.Compare(haAddr, link.Attrs().HardwareAddr) == 0 && link.Attrs().Name != netConf.Bond && link.Type() != "vlan" {
// MAC address match is used over all other matches
return netConf, true
}