Skip to content

Commit 547fa9b

Browse files
authored
Merge pull request #1225 from ioito/hotfix/qx-ignore-non-gateway-nic
fix(esxi): ignore no default gateway host nic
2 parents 7d69312 + ef16ecd commit 547fa9b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/multicloud/esxi/host.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,15 @@ func (host *SHost) fetchNicInfo(debug bool) []sHostNicInfo {
444444
}
445445

446446
for _, nic := range vnics {
447+
if nic.Spec.IpRouteSpec == nil {
448+
continue
449+
}
450+
if nic.Spec.IpRouteSpec.IpRouteConfig.GetHostIpRouteConfig() == nil {
451+
continue
452+
}
453+
if len(nic.Spec.IpRouteSpec.IpRouteConfig.GetHostIpRouteConfig().DefaultGateway) == 0 {
454+
continue
455+
}
447456
// log.Debugf("vnic %d: %s %#v", i, jsonutils.Marshal(nic), nic)
448457
mac := netutils.FormatMacAddr(nic.Spec.Mac)
449458
pnic := findHostNicByMac(nicInfoList, mac)

0 commit comments

Comments
 (0)