Commit 18a991be authored by Ad Schellevis's avatar Ad Schellevis

(legacy) ditch get_possible_traffic_source_addresses(),...

(legacy) ditch get_possible_traffic_source_addresses(), https://github.com/opnsense/core/issues/1257
parent 33d1edc8
......@@ -1797,6 +1797,7 @@ function system_arp_wrong_if()
}
function get_possible_listen_ips($include_ipv6_link_local = false, $include_loopback = true) {
global $config;
$interfaces = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
$listenips = array();
......@@ -1825,12 +1826,6 @@ function get_possible_listen_ips($include_ipv6_link_local = false, $include_loop
$tmp["value"] = "lo0";
$listenips[] = $tmp;
}
return $listenips;
}
function get_possible_traffic_source_addresses($include_ipv6_link_local=false) {
global $config;
$sourceips = get_possible_listen_ips($include_ipv6_link_local);
foreach (array('server', 'client') as $mode) {
if (isset($config['openvpn']["openvpn-{$mode}"]) && is_array($config['openvpn']["openvpn-{$mode}"])) {
foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) {
......@@ -1838,12 +1833,12 @@ function get_possible_traffic_source_addresses($include_ipv6_link_local=false) {
$vpn = array();
$vpn['value'] = 'ovpn' . substr($mode, 0, 1) . $setting['vpnid'];
$vpn['name'] = "OpenVPN {$mode}: " . htmlspecialchars($setting['description']);
$sourceips[] = $vpn;
$listenips[] = $vpn;
}
}
}
}
return $sourceips;
return $listenips;
}
function load_crypto_module()
......
......@@ -436,7 +436,7 @@ $(document).ready(function() {
<select name="sourceip" class="form-control">
<option value=""><?=gettext('Default (any)') ?></option>
<?php
foreach (get_possible_traffic_source_addresses(false) as $sip):?>
foreach (get_possible_listen_ips(false) as $sip):?>
<option value="<?=$sip['value'];?>" <?=!link_interface_to_bridge($sip['value']) && ($sip['value'] == $pconfig['sourceip']) ? "selected=\"selected\"" : "";?>>
<?=htmlspecialchars($sip['name']);?>
</option>
......
......@@ -126,7 +126,7 @@ include("head.inc"); ?>
<select name="sourceip" class="selectpicker">
<option value=""><?= gettext('Default') ?></option>
<?php
foreach (get_possible_traffic_source_addresses(true) as $sip):?>
foreach (get_possible_listen_ips(true) as $sip):?>
<option value="<?=$sip['value'];?>" <?=!link_interface_to_bridge($sip['value']) && ($sip['value'] == $pconfig['sourceip']) ? "selected=\"selected\"" : "";?>>
<?=htmlspecialchars($sip['name']);?>
</option>
......
......@@ -187,7 +187,7 @@ include("head.inc"); ?>
<select name="sourceip" class="selectpicker" data-size="5" data-live-search="true">
<option value=""><?= gettext('Any') ?></option>
<?php
foreach (get_possible_traffic_source_addresses(true) as $sip):?>
foreach (get_possible_listen_ips(true) as $sip):?>
<option value="<?=$sip['value'];?>" <?=!link_interface_to_bridge($sip['value']) && ($sip['value'] == $sourceip) ? "selected=\"selected\"" : "";?>>
<?=htmlspecialchars($sip['name']);?>
</option>
......
......@@ -128,7 +128,7 @@ include("head.inc");
<select name="sourceip" class="selectpicker">
<option value=""><?= gettext('Any') ?></option>
<?php
foreach (get_possible_traffic_source_addresses(true) as $sip):?>
foreach (get_possible_listen_ips(true) as $sip):?>
<option value="<?=$sip['value'];?>" <?=!link_interface_to_bridge($sip['value']) && ($sip['value'] == $pconfig['sourceip']) ? "selected=\"selected\"" : "";?>>
<?=htmlspecialchars($sip['name']);?>
</option>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment