Subject: | Warning generated on Perl 5.24.0 |
Thanks for the module!
In this module, in _inetNtoa(), you check the version of the Socket module with a numeric comparison. Unfortunately $Socket::VERSION in the version of Socket distributed as a core module with Perl 5.24.0 is "2.020_03", so when the comparison is done, Perl generates a warning that the VERSION variable is not numeric in a numeric comparison.
In addition to the warning, it will fall back to the pre-1.94 code where Socket doesn't support IPv6. That's also probably not what is desired.
One possible fix is to, instead of checking the version number, to instead check to see if the IPv6 ntoa-ish function exists using can().
Patch:
diff -rp0 -c Net-SNMPTrapd-0.16/lib/Net/SNMPTrapd.pm Net-SNMPTrapd/lib/Net/SNMPTrapd.pm
*** Net-SNMPTrapd-0.16/lib/Net/SNMPTrapd.pm 2015-03-19 18:23:25.000000000 -0600
--- Net-SNMPTrapd/lib/Net/SNMPTrapd.pm 2016-12-06 22:55:53.164891064 -0700
*************** sub _inetNtoa {
*** 529 ****
! if ($Socket::VERSION >= 1.94) {
--- 529 ----
! if (Socket->can('pack_sockaddr_in6')) {