Skip to content

Commit 0507e66

Browse files
committed
Perl: Suppress a warning message
Suppress the following warning message: Attempt to call undefined import method with arguments ("AF_INET6" ...) via package "Socket6" (Perhaps you forgot to load the package?) at (eval 5) line 1. Fixes: net-snmp#954
1 parent 695ac0e commit 0507e66

File tree

1 file changed

+4
-2
lines changed
  • testing/fulltests/support

1 file changed

+4
-2
lines changed

testing/fulltests/support/myip

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
use strict;
1010
use warnings;
1111
import IO::Socket::INET6;
12-
if (eval "Socket6->import(qw(AF_INET6 inet_ntop inet_pton pack_sockaddr_in6
13-
sockaddr_in6))") {
12+
# For older Perl versions AF_INET6 is defined in the Socket6 package. For newer
13+
# Perl versions all IPv6 functionality we need is defined in the Socket package.
14+
if (eval "use Socket6 qw(AF_INET6 inet_ntop inet_pton pack_sockaddr_in6
15+
sockaddr_in6)") {
1416
use Socket qw(AF_INET SOCK_DGRAM pack_sockaddr_in sockaddr_in);
1517
} else {
1618
use Socket qw(AF_INET AF_INET6 SOCK_DGRAM inet_ntop inet_pton

0 commit comments

Comments
 (0)