summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-08-20 14:37:02 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-08-20 14:39:06 -0300
commit8f61cb87ecd12fe9da633546d59397dc2b61ebcc (patch)
tree919ebd7da0c224e1935e2860bff4fbdf3c8c969c /usr
parent45ce573dae865e4ff9ae12fd89eeca5d5250b0cd (diff)
downloadpfsense-8f61cb87ecd12fe9da633546d59397dc2b61ebcc.zip
pfsense-8f61cb87ecd12fe9da633546d59397dc2b61ebcc.tar.gz
Add scope to target when it is a link-local, it helps ticket #3150
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/diag_ping.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php
index 2270264..6bb9184 100755
--- a/usr/local/www/diag_ping.php
+++ b/usr/local/www/diag_ping.php
@@ -147,15 +147,21 @@ include("head.inc"); ?>
echo "<font face='terminal' size='2'>";
echo "<strong>" . gettext("Ping output") . ":</strong><br>";
echo('<pre>');
+ $ifscope = '';
$command = "/sbin/ping";
if ($ipproto == "ipv6") {
$command .= "6";
$ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ipv6($sourceip);
+ if (is_linklocal($ifaddr))
+ $ifscope = get_ll_scope($ifaddr);
} else {
$ifaddr = is_ipaddr($sourceip) ? $sourceip : get_interface_ip($sourceip);
}
- if ($ifaddr && (is_ipaddr($host) || is_hostname($host)))
+ if ($ifaddr && (is_ipaddr($host) || is_hostname($host))) {
$srcip = "-S" . escapeshellarg($ifaddr);
+ if (is_linklocal($host) && !strstr($host, "%") && !empty($ifscope))
+ $host .= "%{$ifscope}";
+ }
$cmd = "{$command} {$srcip} -c" . escapeshellarg($count) . " " . escapeshellarg($host);
//echo "Ping command: {$cmd}\n";
@@ -173,4 +179,4 @@ include("head.inc"); ?>
</form>
</td></tr>
</table>
-<?php include("fend.inc"); ?> \ No newline at end of file
+<?php include("fend.inc"); ?>
OpenPOWER on IntegriCloud