Ticket #45 (closed defect: fixed)

Opened 9 years ago

Last modified 3 years ago

[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:1 Changed 7 years ago by human

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 {

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:2 Changed 7 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 6 years 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 6 years 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 6 years ago by oetiker

  • Owner changed from somebody to oetiker

thanks ... forwarded to simon leinen ... will integrate when he is ok with it.

comment:6 Changed 6 years ago by oetiker

  • milestone milestone1 deleted

Milestone milestone1 deleted

comment:7 Changed 6 years ago by oetiker

fix is integrated in r330

comment:8 Changed 6 years ago by oetiker

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.
 

NOTE: The content of this website is accessible with any browser. The graphical design though relies completely on CSS2 styles. If you see this text, this means that your browser does not support CSS2. Consider upgrading to a standard conformant browser like Mozilla Firefox or Opera but also Apple's Safari or KDE's Konqueror for example.