mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-29 03:51:54 +08:00
fix(host): make sure it won't match vpc guests by accident
This commit is contained in:
@@ -993,10 +993,13 @@ func (s *SKVMGuestInstance) ExecSuspendTask(ctx context.Context) {
|
||||
func (s *SKVMGuestInstance) GetNicDescMatch(mac, ip, port, bridge string) jsonutils.JSONObject {
|
||||
nics, _ := s.Desc.GetArray("nics")
|
||||
for _, nic := range nics {
|
||||
nicBridge, _ := nic.GetString("bridge")
|
||||
if bridge == "" && nicBridge != "" && nicBridge == options.HostOptions.OvnIntegrationBridge {
|
||||
continue
|
||||
}
|
||||
nicMac, _ := nic.GetString("mac")
|
||||
nicIp, _ := nic.GetString("ip")
|
||||
nicPort, _ := nic.GetString("ifname")
|
||||
nicBridge, _ := nic.GetString("bridge")
|
||||
if (len(mac) == 0 || netutils2.MacEqual(nicMac, mac)) &&
|
||||
(len(ip) == 0 || nicIp == ip) &&
|
||||
(len(port) == 0 || nicPort == port) &&
|
||||
|
||||
Reference in New Issue
Block a user