diff options
author | stilez <stilez@users.noreply.github.com> | 2016-03-21 04:07:16 +0000 |
---|---|---|
committer | stilez <stilez@users.noreply.github.com> | 2016-03-21 04:07:16 +0000 |
commit | 430cee6596a13dae4d29fb63393dffe0c6eb4915 (patch) | |
tree | 2149b5fceaaac53270ff3ebd8d03bd8f161ff4e9 /src | |
parent | d3f3b75f1a1a7428600c078540a8ea46cb70f475 (diff) | |
download | pfsense-430cee6596a13dae4d29fb63393dffe0c6eb4915.zip pfsense-430cee6596a13dae4d29fb63393dffe0c6eb4915.tar.gz |
replace apparently pointless function in 2 files
Code loops through all return values of get_possible_traffic_source_addresses(true) to create a list of key=>descript list, but the original function returned exactly such a list anyhow with no other data associated with the keys. So the code seems pointless as it replicates exactly the original return value from possible_traffic_source_addresses().
A quick search shows the rewritten code in this PR is already used in diag_testport.php line 287 and status_logs_settings.php line 356 (repo search: https://github.com/pfsense/pfsense/search?utf8=%E2%9C%93&q=get_possible_traffic_source_addresses )
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/diag_ping.php | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/usr/local/www/diag_ping.php b/src/usr/local/www/diag_ping.php index e5756b6..7cf8301 100644 --- a/src/usr/local/www/diag_ping.php +++ b/src/usr/local/www/diag_ping.php @@ -74,18 +74,6 @@ $do_ping = false; $host = ''; $count = DEFAULT_COUNT; -function create_sourceaddresslist() { - $sourceips = get_possible_traffic_source_addresses(true); - - $list = array("" => gettext('Default')); - - foreach ($sourceips as $sipvalue => $sipname) { - $list[$sipvalue] = $sipname; - } - - return $list; -} - if ($_POST || $_REQUEST['host']) { unset($input_errors); unset($do_ping); @@ -190,7 +178,7 @@ $section->addInput(new Form_Select( 'sourceip', 'Source address', $sourceip, - create_sourceaddresslist() + array('' => gettext('Automatically selected (default)')) + get_possible_traffic_source_addresses(true) ))->setHelp('Select source address for the ping'); $section->addInput(new Form_Select( |