summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_ping.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-04-02 11:28:10 -0400
committerjim-p <jimp@pfsense.org>2013-04-02 11:50:16 -0400
commitdbd182af2eeadd00897d6406e8a451e9e01d700e (patch)
tree52e07761477b025d92424d3f394da5b234f49883 /usr/local/www/diag_ping.php
parentac7f1763e1712dd85335f09d0434444cee2a6683 (diff)
downloadpfsense-dbd182af2eeadd00897d6406e8a451e9e01d700e.zip
pfsense-dbd182af2eeadd00897d6406e8a451e9e01d700e.tar.gz
Fix/simplify some logic
Diffstat (limited to 'usr/local/www/diag_ping.php')
-rwxr-xr-xusr/local/www/diag_ping.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php
index 0c73f21..98a3bdd 100755
--- a/usr/local/www/diag_ping.php
+++ b/usr/local/www/diag_ping.php
@@ -150,14 +150,14 @@ include("head.inc"); ?>
$command = "/sbin/ping";
if ($ipproto == "ipv6") {
$command .= "6";
- $ifaddr = get_interface_ipv6($sourceip);
+ $ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ipv6($sourceip);
} else {
$ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ip($sourceip);
}
if ($ifaddr && (is_ipaddr($host) || is_hostname($host)))
- $cmd = "{$command} -S" . escapeshellarg($ifaddr) . " -c" . escapeshellarg($count) . " " . escapeshellarg($host);
- else
- $cmd = "{$command} -c" . escapeshellarg($count) . " " . escapeshellarg($host);
+ $srcip = "-S" . escapeshellarg($ifaddr);
+
+ $cmd = "{$command} {$srcip} -c" . escapeshellarg($count) . " " . escapeshellarg($host);
//echo "Ping command: {$cmd}\n";
system($cmd);
echo('</pre>');
OpenPOWER on IntegriCloud