mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Be more careful when performing a ping to use the correct ping type if an IP address is entered.
This commit is contained in:
parent
6db5822430
commit
94ca4e0d47
@ -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));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user