From a4e976f8fb83f8b01d1c0b9c5d3ae2710830d0b6 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Tue, 9 Jan 2018 14:35:01 +0100 Subject: [PATCH 1/2] CLOUDSTACK-10220: Configure IPv4 NIC alias on VR regardless of IPv6 IPv4 and IPv6 are two different protocols and the presence of IPv6 in a network does not mean that IPv4 aliases/multiple subnets should not be configured or supported by the VR. This if-statement was written almost 5 years ago in a attempt to add IPv6 support to CloudStack but was never fully implemented. Signed-off-by: Wido den Hollander --- .../cloudstack/engine/orchestration/NetworkOrchestrator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java index 9afd642f7ae3..21030f544a7c 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java @@ -1308,7 +1308,7 @@ protected boolean prepareElement(final NetworkElement element, final Network net final DhcpServiceProvider sp = (DhcpServiceProvider)element; final Map dhcpCapabilities = element.getCapabilities().get(Service.Dhcp); final String supportsMultipleSubnets = dhcpCapabilities.get(Capability.DhcpAccrossMultipleSubnets); - if (supportsMultipleSubnets != null && Boolean.valueOf(supportsMultipleSubnets) && profile.getIPv6Address() == null) { + if (supportsMultipleSubnets != null && Boolean.valueOf(supportsMultipleSubnets)) { if (!sp.configDhcpSupportForSubnet(network, profile, vmProfile, dest, context)) { return false; } From 717e40ed8ea3be9d6398b56abdc3792024c887b3 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Tue, 9 Jan 2018 14:37:03 +0100 Subject: [PATCH 2/2] CLOUDSTACK-10220: Simplify if-statement by using already present method The function isDhcpAccrossMultipleSubnetsSupported() in the same file already does what this if-statement does. This removes duplicate code. Signed-off-by: Wido den Hollander --- .../cloudstack/engine/orchestration/NetworkOrchestrator.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java index 21030f544a7c..cec2e5926c17 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java @@ -1306,9 +1306,7 @@ protected boolean prepareElement(final NetworkElement element, final Network net if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Dhcp) && _networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp, element.getProvider()) && element instanceof DhcpServiceProvider) { final DhcpServiceProvider sp = (DhcpServiceProvider)element; - final Map dhcpCapabilities = element.getCapabilities().get(Service.Dhcp); - final String supportsMultipleSubnets = dhcpCapabilities.get(Capability.DhcpAccrossMultipleSubnets); - if (supportsMultipleSubnets != null && Boolean.valueOf(supportsMultipleSubnets)) { + if (isDhcpAccrossMultipleSubnetsSupported(sp)) { if (!sp.configDhcpSupportForSubnet(network, profile, vmProfile, dest, context)) { return false; }