Merge pull request #8 from kimma/fix-ipv6-issues

Fix ipv6 issues
This commit is contained in:
Tamer 2022-12-27 10:23:41 +01:00 committed by GitHub
commit b1ccf61f61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -167,7 +167,7 @@ class LookingGlass
*/ */
public static function ping(string $host, int $count = 4): bool public static function ping(string $host, int $count = 4): bool
{ {
return self::procExecute('ping -c' . $count . ' -w15', $host); return self::procExecute('ping -4 -c' . $count . ' -w15', $host);
} }
/** /**

View file

@ -46,7 +46,7 @@ if (!empty($_POST)) {
} }
if (in_array($_POST['backendMethod'], ['ping6', 'mtr6', 'traceroute6'])) { if (in_array($_POST['backendMethod'], ['ping6', 'mtr6', 'traceroute6'])) {
if (!LookingGlass::isValidIpv6($_POST['targetHost']) || if (!LookingGlass::isValidIpv6($_POST['targetHost']) &&
!$targetHost = LookingGlass::isValidHost($_POST['targetHost'],LookingGlass::IPV6) !$targetHost = LookingGlass::isValidHost($_POST['targetHost'],LookingGlass::IPV6)
) { ) {
exitErrorMessage('No valid IPv6 provided.'); exitErrorMessage('No valid IPv6 provided.');