Ticket #45 (closed defect: fixed)
[patch] ERROR Subroutine SNMPv1_Session::AF_INET6
| Reported by: | human | Owned by: | oetiker |
|---|---|---|---|
| Version: | 2.x | Keywords: | Subroutine SNMPv1_Session::AF_INET6 |
| Cc: |
Description
When I run mrtg command
/usr/local/bin/mrtg /usr/local/etc/mrtg/server-01-mrtg.cfg
it give me error as below Subroutine SNMPv1_Session::AF_INET6 redefined at /usr/local/lib/perl5/5.8.8/Exporter.pm line 66. at /usr/local/lib/perl5/site_perl/5.8.8/SNMP_Session.pm line 594
Change History
comment:2 Changed 2 years ago by human
*grumble*, wiki formatting..
--- lib/mrtg2/SNMP_Session.pm.orig Tue Dec 22 12:49:07 2009
+++ lib/mrtg2/SNMP_Session.pm Tue Dec 22 12:50:27 2009
@@ -146,7 +146,7 @@ BEGIN {
if (eval {local $SIG{__DIE__};require Socket6;} &&
eval {local $SIG{__DIE__};require IO::Socket::INET6; IO::Socket::INET6->VERSION("1.26");}) {
- import Socket6;
+ Socket6->import(qw(pack_sockaddr_in6 inet_pton));
$ipv6_addr_len = length(pack_sockaddr_in6(161, inet_pton(AF_INET6(), "::1")));
$SNMP_Session::ipv6available = 1;
}
@@ -601,7 +601,7 @@ use Carp;
BEGIN {
if($SNMP_Session::ipv6available) {
import IO::Socket::INET6;
- import Socket6;
+ Socket6->import(qw(pack_sockaddr_in6 inet_pton));
}
}
comment:3 Changed 21 months ago by human
- Summary changed from ERROR Subroutine SNMPv1_Session::AF_INET6 to [patch] ERROR Subroutine SNMPv1_Session::AF_INET6
getaddrinfo must also be imported, add it to both Socket6->import lines in the diff.
comment:4 Changed 21 months ago by human
patch updated to add getaddrinfo.
--- SNMP_Session.pm.orig Mon May 17 14:59:20 2010
+++ SNMP_Session.pm Tue May 18 12:49:00 2010
@@ -146,7 +146,7 @@ BEGIN {
if (eval {local $SIG{__DIE__};require Socket6;} &&
eval {local $SIG{__DIE__};require IO::Socket::INET6; IO::Socket::INET6->VERSION("1.26");}) {
- import Socket6;
+ Socket6->import(qw(pack_sockaddr_in6 inet_pton getaddrinfo));
$ipv6_addr_len = length(pack_sockaddr_in6(161, inet_pton(AF_INET6(), "::1")));
$SNMP_Session::ipv6available = 1;
}
@@ -601,7 +601,7 @@ use Carp;
BEGIN {
if($SNMP_Session::ipv6available) {
import IO::Socket::INET6;
- import Socket6;
+ Socket6->import(qw(pack_sockaddr_in6 inet_pton getaddrinfo));
}
}
comment:5 Changed 20 months ago by oetiker
- Owner changed from somebody to oetiker
thanks ... forwarded to simon leinen ... will integrate when he is ok with it.


I think that's this one...
--- lib/mrtg2/SNMP_Session.pm.orig Tue Dec 22 12:49:07 2009 +++ lib/mrtg2/SNMP_Session.pm Tue Dec 22 12:50:27 2009 @@ -146,7 +146,7 @@ BEGIN {
+ Socket6->import(qw(pack_sockaddr_in6 inet_pton));
@@ -601,7 +601,7 @@ use Carp;
+ Socket6->import(qw(pack_sockaddr_in6 inet_pton));