fix(region): fail to update network gateway

This commit is contained in:
Qiu Jian
2021-03-11 14:53:59 +08:00
parent 37a72cfccf
commit b92d3a93f8
+4
View File
@@ -1635,6 +1635,10 @@ func (self *SNetwork) validateUpdateData(ctx context.Context, userCred mcclient.
if endIp.NetAddr(masklen) != netAddr {
return input, httperrors.NewInputParameterError("start, end ip must be in the same subnet")
}
} else {
startIp, _ = netutils.NewIPV4Addr(self.GuestIpStart)
endIp, _ = netutils.NewIPV4Addr(self.GuestIpEnd)
netAddr = startIp.NetAddr(masklen)
}
for key, ipStr := range map[string]string{