Skip to content

Commit

Permalink
fix(legacy): stop setting gateway on gateway-less subnets (#1860) (#2009
Browse files Browse the repository at this point in the history
)

* fix(legacy): stop setting gateway on gateway-less subnets (#1860)

Co-authored-by: Caleb Ellis <[email protected]>
  • Loading branch information
vtapia and Caleb Ellis committed Dec 17, 2020
1 parent e4d7b41 commit 9c22616
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 4 additions & 3 deletions legacy/src/app/controllers/tests/test_vlan_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ describe("VLANDetailsController", function () {

it(
"prepares provideDHCPAction on actionOptionChanged " +
"and populates suggested gateway",
"and populates the suggested gateway placeholder",

function () {
var controller = makeControllerResolveSetActiveItem();
controller.subnets[0].gateway_ip = null;
Expand All @@ -390,8 +391,8 @@ describe("VLANDetailsController", function () {
startPlaceholder: "(no available IPs)",
endIP: "",
endPlaceholder: "(no available IPs)",
gatewayIP: "192.168.0.1",
gatewayPlaceholder: "192.168.0.1",
gatewayIP: "",
gatewayPlaceholder: "192.168.0.1 (optional)",
needsGatewayIP: true,
subnetMissingGatewayIP: true,
needsDynamicRange: false,
Expand Down
9 changes: 2 additions & 7 deletions legacy/src/app/controllers/vlan_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,8 @@ export function VLANDetailsController(
dhcp.endPlaceholder = "(no available IPs)";
}
if (angular.isString(suggested_gateway)) {
if (forRelay) {
dhcp.gatewayIP = "";
dhcp.gatewayPlaceholder = suggested_gateway + " (optional)";
} else {
dhcp.gatewayIP = suggested_gateway;
dhcp.gatewayPlaceholder = suggested_gateway;
}
dhcp.gatewayIP = "";
dhcp.gatewayPlaceholder = suggested_gateway + " (optional)";
} else {
// This means the subnet already has a gateway, so don't
// bother populating it.
Expand Down

0 comments on commit 9c22616

Please sign in to comment.