Merge pull request #10388 from swordqiu/automated-cherry-pick-of-#10387-upstream-release-3.7

Automated cherry pick of #10387: fix(region): fail to update network gateway
This commit is contained in:
Zexi Li
2021-03-12 17:37:58 +08:00
committed by GitHub
+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{