Merge pull request #3766 from phil-davis/gwbl-issue-7659-RELENG_2_3_4

This commit is contained in:
Renato Botelho 2017-06-26 10:12:01 -03:00
commit 02b661c8bc

View File

@ -500,14 +500,16 @@ if ($_POST) {
if ($_POST['defaultgw'] == "yes" || $_POST['defaultgw'] == "on") {
$i = 0;
/* remove the default gateway bits for all gateways with the same address family */
foreach ($a_gateway_item as $gw) {
if ($gateway['ipprotocol'] == $gw['ipprotocol']) {
unset($config['gateways']['gateway_item'][$i]['defaultgw']);
if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw']) {
$reloadif = $gw['interface'];
if (is_array($a_gateway_item)) {
foreach ($a_gateway_item as $gw) {
if ($gateway['ipprotocol'] == $gw['ipprotocol']) {
unset($config['gateways']['gateway_item'][$i]['defaultgw']);
if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw']) {
$reloadif = $gw['interface'];
}
}
$i++;
}
$i++;
}
$gateway['defaultgw'] = true;
}