summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_ping.php
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2010-10-23 12:28:14 +0200
committerSeth Mos <seth.mos@dds.nl>2010-10-23 12:28:14 +0200
commit8bea96391f790fa48156d2e26c6e75455e50138b (patch)
tree77a6709ff3c3f84d1bae3127686cb18f5fa8aba1 /usr/local/www/diag_ping.php
parent86551a0623d80616bc7c6cc3a5ca6e122274b8c6 (diff)
downloadpfsense-8bea96391f790fa48156d2e26c6e75455e50138b.zip
pfsense-8bea96391f790fa48156d2e26c6e75455e50138b.tar.gz
So gethostbyname() does not work for ipv6, instead run both ping and ping6. That works too.
Diffstat (limited to 'usr/local/www/diag_ping.php')
-rwxr-xr-xusr/local/www/diag_ping.php28
1 files changed, 12 insertions, 16 deletions
diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php
index 3715cf8..155f0f7 100755
--- a/usr/local/www/diag_ping.php
+++ b/usr/local/www/diag_ping.php
@@ -29,7 +29,7 @@
*/
/*
- pfSense_BUILDER_BINARIES: /sbin/ping
+ pfSense_BUILDER_BINARIES: /sbin/ping /sbin/ping6
pfSense_MODULE: routing
*/
@@ -61,7 +61,7 @@ if ($_POST || $_REQUEST['host']) {
if (!$input_errors) {
$do_ping = true;
- $host = gethostbyname($_REQUEST['host']);
+ $host = $_REQUEST['host'];
$interface = $_REQUEST['interface'];
$count = $_POST['count'];
if (preg_match('/[^0-9]/', $count) )
@@ -125,20 +125,16 @@ include("head.inc"); ?>
echo "<font face='terminal' size='2'>";
echo "<strong>" . gettext("Ping output") . ":</strong><br>";
echo('<pre>');
- if(is_ipaddrv4($host)) {
- $ifaddr = get_interface_ip($interface);
- if ($ifaddr)
- system("/sbin/ping -S$ifaddr -c$count " . escapeshellarg($host));
- else
- system("/sbin/ping -c$count " . escapeshellarg($host));
- }
- if(is_ipaddrv6($host)) {
- $ifaddr = get_interface_ipv6($interface);
- if ($ifaddr)
- system("/sbin/ping6 -S$ifaddr -c$count " . escapeshellarg($host));
- else
- system("/sbin/ping6 -c$count " . escapeshellarg($host));
- }
+ $ifaddr = get_interface_ip($interface);
+ if ($ifaddr)
+ system("/sbin/ping -S$ifaddr -c$count " . escapeshellarg($host));
+ else
+ system("/sbin/ping -c$count " . escapeshellarg($host));
+ $ifaddr = get_interface_ipv6($interface);
+ if ($ifaddr)
+ system("/sbin/ping6 -S$ifaddr -c$count " . escapeshellarg($host));
+ else
+ system("/sbin/ping6 -c$count " . escapeshellarg($host));
echo('</pre>');
}
OpenPOWER on IntegriCloud