weizhouapache commented on issue #12621: URL: https://github.com/apache/cloudstack/issues/12621#issuecomment-3877650175
> [@weizhouapache](https://github.com/weizhouapache) for the pointer, you're right — it is a regression from [#11249](https://github.com/apache/cloudstack/pull/11249). > > I confirmed that setting the Public network's `cidr`/`gateway` to `NULL` does make the VPC restart work: > > UPDATE networks SET cidr = NULL, gateway = NULL WHERE id = 200; > -- restartVPC cleanup=true → SUCCESS > However, **the values get repopulated** every time a new public IP range (VLAN) is added. The problem is in `ConfigurationManagerImpl.addCidrAndGatewayForIpv4()` (introduced by [#11249](https://github.com/apache/cloudstack/pull/11249)) — it's called for **all** network types without checking if the network is Shared: > > // ConfigurationManagerImpl.java ~line 5440 — no network type check > if (vlan != null) { > if (ipv4) { > addCidrAndGatewayForIpv4(networkId, vlanGateway, vlanNetmask); // called for ANY network > } > } > So the `addCidrAndGatewayForIpv4` / `addCidrAndGatewayForIpv6` methods append comma-separated CIDRs to the Public network too, not just Shared networks as intended. @jeanvetorello your analysis is correct. `no network type check` - we do need to add a check cc @sureshanaparti -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
