summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_ping.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-03-11 10:44:42 -0400
committerjim-p <jimp@pfsense.org>2013-03-11 10:44:42 -0400
commit94ca4e0d47cf61b8e8c812ca3dc18356fc166fb0 (patch)
tree864e280415af2428538506b6f1c6478e2d872ca2 /usr/local/www/diag_ping.php
parent6db5822430fc9882077aff47e8df4874bab6e469 (diff)
downloadpfsense-94ca4e0d47cf61b8e8c812ca3dc18356fc166fb0.zip
pfsense-94ca4e0d47cf61b8e8c812ca3dc18356fc166fb0.tar.gz
Be more careful when performing a ping to use the correct ping type if an IP address is entered.
Diffstat (limited to 'usr/local/www/diag_ping.php')
-rwxr-xr-xusr/local/www/diag_ping.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php
index a84810e..655de94 100755
--- a/usr/local/www/diag_ping.php
+++ b/usr/local/www/diag_ping.php
@@ -126,12 +126,12 @@ include("head.inc"); ?>
echo "<strong>" . gettext("Ping output") . ":</strong><br>";
echo('<pre>');
$ifaddr = get_interface_ip($interface);
- if ($ifaddr)
+ if ($ifaddr && (is_ipaddrv4($host) || is_hostname($host)))
system("/sbin/ping -S$ifaddr -c$count " . escapeshellarg($host));
else
system("/sbin/ping -c$count " . escapeshellarg($host));
$ifaddr = get_interface_ipv6($interface);
- if ($ifaddr)
+ if ($ifaddr && (is_ipaddrv6($host) || is_hostname($host)))
system("/sbin/ping6 -S$ifaddr -c$count " . escapeshellarg($host));
else
system("/sbin/ping6 -c$count " . escapeshellarg($host));
OpenPOWER on IntegriCloud