mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix snmp test for ipv6
Just check that the port is present, not the exact form of the IP address.
This commit is contained in:
parent
b420d09f4d
commit
c289f5241d
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ if (ip2long($ip) === FALSE) {
|
|||
$port = 1161;
|
||||
$session = new SNMP(SNMP::VERSION_1, "$hostname:$port", $community, $timeout, $retries);
|
||||
$info = $session->info;
|
||||
if (strcmp($info["hostname"], "$ip:$port") !== 0) {
|
||||
if (!str_ends_with($info["hostname"], ":$port")) {
|
||||
echo "'" . $info["hostname"] . "' != '$ip:$port'\n";
|
||||
}
|
||||
var_dump($session->close());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue