From de84c1cd69bb477813453d6c6bfc6dbd7ff6331e Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 19 Aug 2020 13:34:29 +0530 Subject: [PATCH 1/2] engine: honour bypass VLAN id/range for L2 networks Commit e894238d904a9c49c1140371f612a51d251efc1 (#3899) allowed private gateways to bypass vlan check while refactoring it did not cover the case for L2 but only shared network. This fix will re-enable honouring the bypass vlan check option for L2 guest network (in addition to the Shared networks). Signed-off-by: Rohit Yadav --- .../cloudstack/engine/orchestration/NetworkOrchestrator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java index 4c6d2603e1e5..c01947348ee1 100644 --- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java +++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java @@ -2529,7 +2529,7 @@ public Network doInTransaction(final TransactionStatus status) { * @param ntwkOff network offering */ private boolean hasGuestBypassVlanOverlapCheck(final boolean bypassVlanOverlapCheck, final NetworkOfferingVO ntwkOff, final boolean isPrivateNetwork) { - return bypassVlanOverlapCheck && (ntwkOff.getGuestType() == GuestType.Shared || isPrivateNetwork); + return bypassVlanOverlapCheck && (ntwkOff.getGuestType() == GuestType.Shared || ntwkOff.getGuestType() == GuestType.L2 || isPrivateNetwork); } /** From c6205fc3659357ba2fa7c1c4d2ed75c13a469497 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 19 Aug 2020 15:30:46 +0530 Subject: [PATCH 2/2] Update NetworkOrchestrator.java --- .../cloudstack/engine/orchestration/NetworkOrchestrator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java index c01947348ee1..ab2d8f3e55c0 100644 --- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java +++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java @@ -2529,7 +2529,7 @@ public Network doInTransaction(final TransactionStatus status) { * @param ntwkOff network offering */ private boolean hasGuestBypassVlanOverlapCheck(final boolean bypassVlanOverlapCheck, final NetworkOfferingVO ntwkOff, final boolean isPrivateNetwork) { - return bypassVlanOverlapCheck && (ntwkOff.getGuestType() == GuestType.Shared || ntwkOff.getGuestType() == GuestType.L2 || isPrivateNetwork); + return bypassVlanOverlapCheck && (ntwkOff.getGuestType() != GuestType.Isolated || isPrivateNetwork); } /**