routing, gateways. In gateway groups you could originally select a vip, which isn't used in our system. orgininally this came from ab1112da4c

Let's remove it while working on https://github.com/opnsense/core/issues/2279
This commit is contained in:
Ad Schellevis 2019-04-15 18:59:13 +02:00
parent 1feaa21fe4
commit 118acc33e5
2 changed files with 3 additions and 46 deletions

View File

@ -365,13 +365,12 @@ function return_gateway_groups_array()
$gateway_groups_array = array();
if (isset($config['gateways']['gateway_group'])) {
$carplist = get_configured_carp_interface_list();
foreach ($config['gateways']['gateway_group'] as $group) {
/* create array with group gateways members separated by tier */
$tiers = array();
$tiers_online = 0;
foreach ($group['item'] as $item) {
list($gwname, $tier, $vipname) = explode("|", $item);
list($gwname, $tier) = explode("|", $item);
if (!isset($tiers[$tier])) {
$tiers[$tier] = array();
}
@ -386,12 +385,7 @@ function return_gateway_groups_array()
} elseif (isset($gateways_arr[$gwname]['monitor_disable'])) {
$gwup = true;
}
$vip = null;
if (!empty($carplist[$vipname]) && is_ipaddr($carplist[$vipname])) {
$vip = $vipname;
}
$tiers[$tier][] = array("up" => $gwup, "gwname" => $gwname, "vip" => $vip);
$tiers[$tier][] = array("up" => $gwup, "gwname" => $gwname);
}
/* sort the tiers array by the tier key */
@ -419,9 +413,6 @@ function return_gateway_groups_array()
$groupmember['int'] = $gateway['if'];
$groupmember['gwip'] = $gatewayip;
$groupmember['weight'] = isset($gateway['weight']) ? $gateway['weight'] : 1;
if (!empty($member_item['vip'])) {
$groupmember['vip'] = $member_item['vip'];
}
$gateway_groups_array[$group['name']][] = $groupmember;
}
}

View File

@ -100,9 +100,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['item'] = array();
foreach ($a_gateways as $gwname => $gateway) {
if (isset($pconfig[$gwname]) && $pconfig[$gwname] > 0) {
$vipname = "{$gwname}_vip";
/* we have a priority above 0 (disabled), add item to list */
$pconfig['item'][] = "{$gwname}|{$pconfig[$gwname]}|{$pconfig[$vipname]}";
$pconfig['item'][] = "{$gwname}|{$pconfig[$gwname]}";
}
/* check for overlaps */
if ($pconfig['name'] == $gwname) {
@ -217,39 +216,6 @@ $( document ).ready(function() {
endfor;?>
</select>
</td>
<td>
<select name="<?=$gwname;?>_vip" class="selectpicker" data-width="auto">
<?php
$selected_key = 'address';
foreach ((array)$pconfig['item'] as $item) {
$itemsplit = explode("|", $item);
if ($itemsplit[0] == $gwname) {
$selected_key = $itemsplit[2];
break;
}
}?>
<option value="address" <?=$selected_key == "address" ? "selected=\"selected\"" :"";?> >
<?=gettext("Interface Address");?>
</option>
<?php
foreach (get_configured_carp_interface_list() as $vip => $address):
if (!preg_match("/^{$gateway['interface']}_/i", $vip)) {
continue;
}
if (($gateway['ipprotocol'] == "inet") && (!is_ipaddrv4($address))) {
continue;
}
if (($gateway['ipprotocol'] == "inet6") && (!is_ipaddrv6($address))) {
continue;
}?>
<option value="<?=$vip;?>" <?=$selected_key == $vip ? "selected=\"selected\"" :"";?> >
<?=$vip;?> - <?=$address;?>
</option>
<?php
endforeach;?>
</select>
</td>
<td><strong><?=$gateway['descr'];?></strong></td>
</tr>
<?php