Skip to content

Commit c289f52

Browse files
committed
Fix snmp test for ipv6
Just check that the port is present, not the exact form of the IP address.
1 parent b420d09 commit c289f52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/snmp/tests/bug60749.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (ip2long($ip) === FALSE) {
2121
$port = 1161;
2222
$session = new SNMP(SNMP::VERSION_1, "$hostname:$port", $community, $timeout, $retries);
2323
$info = $session->info;
24-
if (strcmp($info["hostname"], "$ip:$port") !== 0) {
24+
if (!str_ends_with($info["hostname"], ":$port")) {
2525
echo "'" . $info["hostname"] . "' != '$ip:$port'\n";
2626
}
2727
var_dump($session->close());

0 commit comments

Comments
 (0)