Skip to content

Commit

Permalink
Merge pull request #289 from fedepaol/taintonlynodeaddr
Browse files Browse the repository at this point in the history
Bug 1879077: ValidateMTU: check only the interface that holds the node ip
  • Loading branch information
openshift-merge-robot committed May 5, 2021
2 parents 3da4d51 + 9540335 commit 9e25637
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/network/node/node.go
Expand Up @@ -268,6 +268,19 @@ func (node *OsdnNode) validateMTU() error {
return fmt.Errorf("could not retrieve link id %d while validating MTU", route.LinkIndex)
}

// we want to check the mtu only for the interface assigned to the node's primary ip
found := false
addresses, err := netlink.AddrList(link, netlink.FAMILY_V4)
for _, address := range addresses {
if node.localIP == address.IP.String() {
found = true
break
}
}
if !found {
continue
}

newmtu := link.Attrs().MTU
if newmtu > 0 && newmtu < mtu {
mtu = newmtu
Expand Down

0 comments on commit 9e25637

Please sign in to comment.