Bug 166777 - some warnings with net-mgmt/mrtg
Summary: some warnings with net-mgmt/mrtg
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dmitry Sivachenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-09 05:00 UTC by TsurutaniNaoki
Modified: 2013-07-26 07:30 UTC (History)
1 user (show)

See Also:


Attachments
patch-lib__mrtg2__SNMP_Session.pm (2.23 KB, text/plain; charset=KOI8-R)
2012-10-22 07:24 UTC, Alexey V. Panfilov
no flags Details
snmp_session.pm.diff (2.20 KB, patch)
2012-10-23 03:43 UTC, TsurutaniNaoki
no flags Details | Diff
p5-SNMP_Session.diff (2.33 KB, patch)
2013-04-11 05:56 UTC, TsurutaniNaoki
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TsurutaniNaoki 2012-04-09 05:00:35 UTC
	some waning messages are found when I run mrtg_daemon script.

Fix: 

I have no idea. p5-SNMP_Session may be fixed...
	mrtg_daemon runs fine.
How-To-Repeat: 	% /usr/local/etc/rc.d/mrtg_daemon start
	Starting mrtg_daemon.
	Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
	 at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 149
	Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
	 at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 149
	Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
	 at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 608
	Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
	 at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 608
	Daemonizing MRTG ...
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-04-09 10:27:38 UTC
Maintainer of net-mgmt/mrtg,

Please note that PR ports/166777 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/166777

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2012-04-09 10:27:39 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Alexey V. Panfilov 2012-04-09 12:41:49 UTC
09.04.2012 13:27, Edwin Groothuis wrote:
> Maintainer of net-mgmt/mrtg,
>
> Please note that PR ports/166777 has just been submitted.
>
> If it contains a patch for an upgrade, an enhancement or a bug fix
> you agree on, reply to this email stating that you approve the patch
> and a committer will take care of it.
>
> The full text of the PR can be found at:
>      http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/166777
>

This warnings, AFAIR, was fixed in p5-SNMP_Session with PRs: 
ports/154367 and ports/154411.

Please, update your p5-SNMP_Session port.

--
Simple Lehisnoe ;-)
Comment 4 Chris Rees freebsd_committer freebsd_triage 2012-04-09 12:56:33 UTC
State Changed
From-To: feedback->closed

Fixed in ports/154367 and ports/154411
Comment 5 TsurutaniNaoki 2012-04-09 22:54:12 UTC
Hi,

This is not fixed in PRs listed, and my p5-SNMP_Session is up-to-date.
I tried p5-SNMP_Session without patch, and found extra error messages:

h120[root] % /usr/local/etc/rc.d/my_mrtg start
Starting my_mrtg_daemon.
Subroutine SNMP_Session::pack_sockaddr_in6 redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
 at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 149
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
 at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 149
Subroutine SNMP_Session::sockaddr_in6 redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
 at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 149
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
 at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 608
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
 at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 608
Subroutine SNMPv1_Session::sockaddr_in6 redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
 at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 608
Daemonizing MRTG ...

I think this problem depends on the version of Perl...


--- 
Tsurutani Naoki
turutani@scphys.kyoto-u.ac.jp
Comment 6 Chris Rees freebsd_committer freebsd_triage 2012-04-10 16:31:36 UTC
State Changed
From-To: closed->open

Apparently it's still a problem
Comment 7 Chris Rees freebsd_committer freebsd_triage 2012-04-10 16:32:14 UTC
Responsible Changed
From-To: freebsd-ports-bugs->crees

I'll take it.
Comment 8 Chris Rees 2012-07-15 09:06:04 UTC
Hi Alexey,

Is there any joy with upstream about this?

Chris
Comment 9 Chris Rees freebsd_committer freebsd_triage 2012-10-19 15:56:46 UTC
State Changed
From-To: open->feedback

Is this still a problem with supported Perl versions? 5.12, 5.14?  If 
so, I'll have a closer look.
Comment 10 TsurutaniNaoki 2012-10-20 00:12:59 UTC
Yes, it still happens on my host, with ports updated yesterday and perl 5.14.2_2.
Comment 11 Alexey V. Panfilov 2012-10-22 07:24:56 UTC
Could you try attached patch?

20.10.2012 03:12, Tsurutani Naoki wrote:
> Yes, it still happens on my host, with ports updated yesterday and perl 5.14.2_2.

--
Simple Lehisnoe ;-)
Comment 12 TsurutaniNaoki 2012-10-23 03:43:56 UTC
Thank you for your patch; but I cannot find the file to be patched...
I tried fixing ${LOCALBASE}/lib/perl/site_perl/5.14.2/SNMP_Session.pm
as your patch: some warnings remains.  I deleted more words, and found no warnings.
Here is a patch to the above file.  I do not know it is right way.
In addition, this problem is specific to my host or OS version ?
Comment 13 Alexey V. Panfilov 2012-10-23 06:36:08 UTC
23.10.2012 06:43, Tsurutani Naoki wrote:

> Thank you for your patch; but I cannot find the file to be patched...

Just put it to /usr/ports/net-mgmt/mrtg/files/

> I tried fixing ${LOCALBASE}/lib/perl/site_perl/5.14.2/SNMP_Session.pm
> as your patch: some warnings remains.  I deleted more words, and found no warnings.
> Here is a patch to the above file.  I do not know it is right way.

Tobi Oetiker (developer of mrtg) modifies mrtg's SNMP_Session.pm.

> In addition, this problem is specific to my host or OS version ?

No, you're not alone - http://oss.oetiker.ch/mrtg-trac/ticket/134
Here is patch http://oss.oetiker.ch/mrtg-trac/changeset/405

--
Simple Lehisnoe ;-)
Comment 14 Chris Rees freebsd_committer freebsd_triage 2012-10-31 17:47:11 UTC
State Changed
From-To: feedback->closed

Fixed for real this time!  Thanks.
Comment 15 quip 2013-03-29 00:45:55 UTC
The bug is still there.

I did a clean install of MRTG on fresh FreeBSD 9.1-RELEASE

For example, if I run cfgmaker, I got following error messages:

# cfgmaker --interfaces --community=public --noreversedns 127.0.0.1
Subroutine SNMP_Session::pack_sockaddr_in6 redefined at 
/usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
  at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 149
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at 
/usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
  at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 149
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at 
/usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
  at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 608
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at 
/usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
  at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 608
--base: Get Device Info on public@127.0.0.1:
--base: Vendor Id: Unknown Vendor - 1.3.6.1.4.1.12325.1.1.2.1.1
--base: Populating confcache
--base: Get Interface Info
--base: Walking ifIndex


Or when mrtg is called from commandline

/usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg --logging 
/var/log/mrtg/mrtg.log

2013-03-29 01:00:01 -- Started mrtg with config 
'/usr/local/etc/mrtg/mrtg.cfg'
2013-03-29 01:00:01 -- Subroutine SNMP_Session::pack_sockaddr_in6 
redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
2013-03-29 01:00:01 -- Subroutine SNMP_Session::unpack_sockaddr_in6 
redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
2013-03-29 01:00:01 -- Subroutine SNMPv1_Session::pack_sockaddr_in6 
redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
2013-03-29 01:00:01 -- Subroutine SNMPv1_Session::unpack_sockaddr_in6 
redefined at /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.


/# uname -srmi
FreeBSD 9.1-RELEASE amd64 GENERIC


# pkg_info -rR mrtg-2.17.4_3,1
Information for mrtg-2.17.4_3,1:

Depends on:
Dependency: perl-5.14.2_3
Dependency: p5-IO-Socket-INET6-2.69
Dependency: p5-SNMP_Session-1.13
Dependency: gd-2.0.35_8,1

Options selected for packages:

# awk -F= '$1 ~ /_SET/ { print $2 }' /var/db/ports/mrtg/options
IPV6

# awk -F= '$1 ~ /_SET/ { print $2 }' /var/db/ports/perl/options
PERL_64BITINT
PTHREAD
USE_PERL
Comment 16 TsurutaniNaoki 2013-03-29 02:39:21 UTC
Hi,

Miroslav Lachman <quip@quip.cz> wrote:

> The bug is still there.
> 
> I did a clean install of MRTG on fresh FreeBSD 9.1-RELEASE
> 
> For example, if I run cfgmaker, I got following error messages:
> 
> # cfgmaker --interfaces --community=public --noreversedns 127.0.0.1
> Subroutine SNMP_Session::pack_sockaddr_in6 redefined at 
> /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
>   at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 149
(snip)

I cannot reproduce it on my host.

> # pkg_info -rR mrtg-2.17.4_3,1
> Information for mrtg-2.17.4_3,1:
> 
> Depends on:
> Dependency: perl-5.14.2_3
> Dependency: p5-IO-Socket-INET6-2.69
> Dependency: p5-SNMP_Session-1.13
> Dependency: gd-2.0.35_8,1

Is there any dependency on p5-Socket6-0.23 via p5-IO-Socket-INET6-2.69 ?

Sincerely,


--- 
Tsurutani Naoki
turutani@scphys.kyoto-u.ac.jp
Comment 17 Miroslav Lachman 2013-03-29 13:46:21 UTC
Tsurutani Naoki wrote:
>> # cfgmaker --interfaces --community=public --noreversedns 127.0.0.1
>> Subroutine SNMP_Session::pack_sockaddr_in6 redefined at
>> /usr/local/lib/perl5/5.14.2/Exporter.pm line 67.
>>    at /usr/local/lib/perl5/site_perl/5.14.2/SNMP_Session.pm line 149
>>      
> (snip)
>
> I cannot reproduce it on my host.
I see it on 4 different servers. All with FreeBSD 9.1-RELEASE and Perl 
5.14.2

I don't see it on machines with 8.3-RELEASE and perl-5.14.2_2 and 
mrtg-2.17.4_2,1

>> # pkg_info -rR mrtg-2.17.4_3,1
>> Information for mrtg-2.17.4_3,1:
>>
>> Depends on:
>> Dependency: perl-5.14.2_3
>> Dependency: p5-IO-Socket-INET6-2.69
>> Dependency: p5-SNMP_Session-1.13
>> Dependency: gd-2.0.35_8,1
>>      
> Is there any dependency on p5-Socket6-0.23 via p5-IO-Socket-INET6-2.69 ?
>    
Full dependency tree

# pkg_tree -v mrtg-2.17.4_3,1
mrtg-2.17.4_3,1
|\__ perl-5.14.2_3
|\__ p5-IO-Socket-INET6-2.69
|     |\__ perl-5.14.2_3
|      \__ p5-Socket6-0.23
|            \__ perl-5.14.2_3
|\__ p5-SNMP_Session-1.13
|      \__ perl-5.14.2_3
  \__ gd-2.0.35_8,1
       |\__ freetype2-2.4.11
       |\__ png-1.5.14
        \__ jpeg-8_4

Let me know if you need some more details (full list of installed 
packages, their options etc.)
Comment 18 TsurutaniNaoki 2013-03-30 12:47:28 UTC
Miroslav Lachman <000.fbsd@quip.cz> wrote:

> I see it on 4 different servers. All with FreeBSD 9.1-RELEASE and Perl 
> 5.14.2
> 
> I don't see it on machines with 8.3-RELEASE and perl-5.14.2_2 and 
> mrtg-2.17.4_2,1

I am very sorry.
I tried on 8.2-PRERELEASE and 9.0-RELEASE after reinstalling related ports,
and found warnings on both host; /usr/local/lib/perl/site_perl/5.14.2/SNMP_Session.pm
was kept modified on the former host.
The previous patch does not resolve problem.
Please fix net-mgmt/p5-SNMP_Session, as I sent previously.
Comment 19 TsurutaniNaoki 2013-04-07 00:42:19 UTC
Would you try this patch ?
This is a patch to ports/net-mgmt/p5-SNMP_Session.
Comment 20 TsurutaniNaoki 2013-04-11 05:56:31 UTC
Sorry, I missed the patch.
Comment 21 mike 2013-04-12 15:04:31 UTC
I started getting the warnings on FreeBSD 8.3 after upgrading Perl from 5.12 
to 5.16. I have mrtg (command-line) running via cron every 5 minutes, so my 
mailbox was filling up with them. I tried Naoki's most recent patch, and it 
worked for me; mrtg is back to normal, no warnings.
Comment 22 lambert 2013-06-26 19:42:50 UTC
This patch also worked for me.  

FreeBSD 9.1-STABLE #0 r246221M 

perl-5.12.4_5   
p5-SNMP_Session-1.13
mrtg-2.17.4_3,1


Maybe this PR should be re-openned and / or a new PR created?

-- 
Scott Lambert
lambert@tcworks.net
Comment 23 Chris Rees freebsd_committer freebsd_triage 2013-06-26 20:03:59 UTC
State Changed
From-To: closed->open

OK, if the patch helps-- Alexey, is it OK with you?
Comment 24 Chris Rees freebsd_committer freebsd_triage 2013-07-10 20:07:38 UTC
State Changed
From-To: open->feedback

Ask for maintainer approval.
Comment 25 Alexey V. Panfilov 2013-07-11 06:10:07 UTC
10.07.2013 23:07, crees@FreeBSD.org wrote:
> Synopsis: some warnings with net-mgmt/mrtg
> 
> State-Changed-From-To: open->feedback
> State-Changed-By: crees
> State-Changed-When: Wed Jul 10 19:07:38 UTC 2013
> State-Changed-Why: 
> Ask for maintainer approval.
> 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=166777

This patch seems to me good - no warnings while mrtg is running. Don't
forget that attached patch is for net-mgmt/p5-SNMP_Session, not for
net-mgmt/mrtg.

-- 
Simple Lehisnoe ;-)
Comment 26 Chris Rees freebsd_committer freebsd_triage 2013-07-14 15:38:15 UTC
Responsible Changed
From-To: crees->demon

Hi Dmitry, 

Please would you commit (or allow me to) the patch at [1], which fixes 
this issue? 

Thanks! 

[1] http://www.bayofrum.net/~crees/patches/p5-SNMP_Session-mrtg.diff
Comment 27 dfilter service freebsd_committer freebsd_triage 2013-07-14 16:14:32 UTC
Author: crees
Date: Sun Jul 14 15:14:19 2013
New Revision: 322986
URL: http://svnweb.freebsd.org/changeset/ports/322986

Log:
  Fix some warnings when using mrtg_daemon.
  
  PR:		ports/166777
  Submitted by:	Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
  Approved by:	demon (maintainer)

Modified:
  head/net-mgmt/p5-SNMP_Session/Makefile
  head/net-mgmt/p5-SNMP_Session/files/patch-SNMP_Session.pm

Modified: head/net-mgmt/p5-SNMP_Session/Makefile
==============================================================================
--- head/net-mgmt/p5-SNMP_Session/Makefile	Sun Jul 14 14:52:01 2013	(r322985)
+++ head/net-mgmt/p5-SNMP_Session/Makefile	Sun Jul 14 15:14:19 2013	(r322986)
@@ -1,12 +1,9 @@
-# New ports collection makefile for:	p5-SNMP_Session
-# Date created:				13 June 1999
-# Whom:					Stephen J. Roznowski <sjr@home.net>
-#
+# Created by: Stephen J. Roznowski <sjr@home.net>
 # $FreeBSD$
-#
 
 PORTNAME=	SNMP_Session
 PORTVERSION=	1.13
+PORTREVISION=	1
 CATEGORIES=	net-mgmt perl5
 MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE}
 PROJECTHOST=	snmp-session
@@ -19,11 +16,13 @@ PERL_CONFIGURE=	yes
 
 DOCSDIR=	${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME}
 
+.include <bsd.port.options.mk>
+
 post-patch:
 	${RM} ${WRKSRC}/lib/SNMP_Session.pm.orig
 
 post-install:
-.if !defined(NOPORTDOCS)
+.if ${PORT_OPTIONS:MDOCS}
 	@${MKDIR} ${DOCSDIR}
 .for file in README README.SNMP_util index.html
 	${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}

Modified: head/net-mgmt/p5-SNMP_Session/files/patch-SNMP_Session.pm
==============================================================================
--- head/net-mgmt/p5-SNMP_Session/files/patch-SNMP_Session.pm	Sun Jul 14 14:52:01 2013	(r322985)
+++ head/net-mgmt/p5-SNMP_Session/files/patch-SNMP_Session.pm	Sun Jul 14 15:14:19 2013	(r322986)
@@ -5,17 +5,54 @@
      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 inet_ntop unpack_sockaddr_in6 getaddrinfo));
++       	Socket6->import(qw(inet_pton inet_ntop getaddrinfo));
  	$ipv6_addr_len = length(pack_sockaddr_in6(161, inet_pton(AF_INET6(), "::1")));
  	$SNMP_Session::ipv6available = 1;
      }
-@@ -601,7 +601,7 @@
+@@ -549,7 +549,7 @@
+     # complaining about AF_INET6 when Socket6 is not available
+ 
+     if( (defined $ipv6_addr_len) && (length $addr == $ipv6_addr_len)) {
+-	($port,$addrunpack) = unpack_sockaddr_in6 ($addr);
++	($port,$addrunpack) = Socket6::unpack_sockaddr_in6 ($addr);
+ 	$addrstr = inet_ntop (AF_INET6(), $addrunpack);
+     } else {
+ 	($port,$addrunpack) = unpack_sockaddr_in ($addr);
+@@ -605,7 +605,7 @@
  BEGIN {
      if($SNMP_Session::ipv6available) {
  	import IO::Socket::INET6;
 -	import Socket6;
-+	Socket6->import(qw(pack_sockaddr_in6 inet_pton inet_ntop unpack_sockaddr_in6 getaddrinfo)); 
++	Socket6->import(qw(inet_pton inet_ntop getaddrinfo)); 
      }
  }
  
-
+@@ -825,8 +825,8 @@
+ 	($p2,$a2) = unpack_sockaddr_in ($sa2);
+     } elsif($this->{'sockfamily'} == AF_INET6()) {
+ 	# IPv6 addresses
+-	($p1,$a1) = unpack_sockaddr_in6 ($sa1);
+-	($p2,$a2) = unpack_sockaddr_in6 ($sa2);
++	($p1,$a1) = Socket6::unpack_sockaddr_in6 ($sa1);
++	($p2,$a2) = Socket6::unpack_sockaddr_in6 ($sa2);
+     } else {
+ 	return 0;
+     }
+@@ -899,7 +899,7 @@
+     return undef unless $remote_addr;
+ 
+     if( (defined $ipv6_addr_len) && (length $remote_addr == $ipv6_addr_len)) {
+-	($port,$iaddr) = unpack_sockaddr_in6($remote_addr);
++	($port,$iaddr) = Socket6::unpack_sockaddr_in6($remote_addr);
+     } else {
+ 	($port,$iaddr) = unpack_sockaddr_in($remote_addr);
+     }
+@@ -948,7 +948,7 @@
+     return undef unless $remote_addr;
+ 
+     if( (defined $ipv6_addr_len) && (length $remote_addr == $ipv6_addr_len)) {
+-	($port,$iaddr) = unpack_sockaddr_in6($remote_addr);
++	($port,$iaddr) = Socket6::unpack_sockaddr_in6($remote_addr);
+     } else {
+ 	($port,$iaddr) = unpack_sockaddr_in($remote_addr);
+     }
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 28 Chris Rees freebsd_committer freebsd_triage 2013-07-14 16:15:22 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!
Comment 29 Miroslav Lachman 2013-07-18 11:41:32 UTC
I see the problem again.

2013-07-18 12:30:01 -- Started mrtg with config 
'/usr/local/etc/mrtg/mrtg.cfg'
2013-07-18 12:30:01 -- Undefined subroutine 
&SNMP_Session::pack_sockaddr_in6 called at 
/usr/local/lib/perl5/site_perl/5.12/SNMP_Session.pm line 150.

I have two similar machines, both FreeBSD 8.4 with the same version and 
configuration of MRTG, but only one has this problem.
The difference is that one machine has AWStats configured with IPv6 
support and it brings dependency on p5-Net-DNS-0.72 and it depends on 
p5-IO-Socket-INET6-2.69

So if p5-IO-Socket-INET6-2.69 is detected in the system, problem is here 
and MRTG is not working.


# uname -srmi
FreeBSD 8.4-RELEASE-p1 amd64 GENERIC


# pkg_tree -v mrtg-2.17.4_3,1
mrtg-2.17.4_3,1
|\__ perl-5.12.5
|\__ p5-SNMP_Session-1.13_1
|      \__ perl-5.12.5
  \__ gd-2.0.35_9,1
       |\__ freetype2-2.4.12_1
       |\__ png-1.5.17
        \__ jpeg-8_4


# cat /var/db/ports/mrtg/options
# This file is auto-generated by 'make config'.
# Options for mrtg-2.17.4_3,1
_OPTIONS_READ=mrtg-2.17.4_3,1
_FILE_COMPLETE_OPTIONS_LIST=DOCS EXAMPLES IPV6 SNMPV3
OPTIONS_FILE_UNSET+=DOCS
OPTIONS_FILE_UNSET+=EXAMPLES
OPTIONS_FILE_UNSET+=IPV6
OPTIONS_FILE_UNSET+=SNMPV3



# pkg_tree -v awstats-7.2,1
awstats-7.2,1
|\__ perl-5.12.5
|\__ p5-Net-IP-1.26
|      \__ perl-5.12.5
|\__ p5-Net-XWhois-0.90_4
|      \__ perl-5.12.5
  \__ p5-Net-DNS-0.72
       |\__ perl-5.12.5
       |\__ p5-Digest-HMAC-1.03
       |      \__ perl-5.12.5
        \__ p5-IO-Socket-INET6-2.69
             |\__ perl-5.12.5
              \__ p5-Socket6-0.23
                    \__ perl-5.12.5



# pkg_info -E p5-\*
p5-BerkeleyDB-0.52
p5-DBD-mysql-4.023
p5-DBI-1.627
p5-Data-Dumper-2.145
p5-Digest-HMAC-1.03
p5-IO-Socket-INET6-2.69
p5-Locale-gettext-1.05_3
p5-Net-DNS-0.72
p5-Net-IP-1.26
p5-Net-XWhois-0.90_4
p5-SNMP_Session-1.13_1
p5-Socket6-0.23
p5-Storable-2.39
p5-Term-ReadKey-2.30
p5-URI-1.60



p5 packages installed on machine, where MRTG works:

# pkg_info -E p5-\*
p5-BerkeleyDB-0.52
p5-DBD-mysql-4.023
p5-DBI-1.627
p5-Data-Dumper-2.145
p5-Locale-gettext-1.05_3
p5-Net-XWhois-0.90_4
p5-SNMP_Session-1.13_1
p5-Storable-2.39
p5-Term-ReadKey-2.30
p5-URI-1.60
Comment 30 TsurutaniNaoki 2013-07-19 23:54:18 UTC
I works fine with p5-IO-Socket-INET6-2.69 on my host... I have no idea.
Comment 31 tedm 2013-07-24 21:03:07 UTC
I have a freshly installed FreeBSD 8.4 RELEASE system with ports updated 
about a week ago and I am still getting this error:

Subroutine SNMP_Session::pack_sockaddr_in6 redefined at 
/usr/local/lib/perl5/5.14/Exporter.pm line 67.
  at /usr/local/lib/perl5/site_perl/5.14/SNMP_Session.pm line 149
Subroutine SNMP_Session::unpack_sockaddr_in6 redefined at 
/usr/local/lib/perl5/5.14/Exporter.pm line 67.
  at /usr/local/lib/perl5/site_perl/5.14/SNMP_Session.pm line 149
Subroutine SNMPv1_Session::pack_sockaddr_in6 redefined at 
/usr/local/lib/perl5/5.14/Exporter.pm line 67.
  at /usr/local/lib/perl5/site_perl/5.14/SNMP_Session.pm line 608
Subroutine SNMPv1_Session::unpack_sockaddr_in6 redefined at 
/usr/local/lib/perl5/5.14/Exporter.pm line 67.
  at /usr/local/lib/perl5/site_perl/5.14/SNMP_Session.pm line 608

IO-Socket-INET6-2.69.tar.gz and mrtg-2.17.4.tar.gz and Perl 5.14.4 are 
installed.

In my case the fix was:

Replace at line 149 & 608 of 
/usr/local/lib/perl5/site_perl/5.14/SNMP_Session.pm

     Socket6->import(qw(pack_sockaddr_in6 inet_pton inet_ntop 
unpack_sockaddr_in6 getaddrinfo));++

with
          Socket6->import(qw(inet_pton inet_ntop getaddrinfo));

Disclaimer:  I don't know why it works, I'm not a Perl programmer.
I just can't have my /var/mail/root filled up with emails from cron.

Please, someone who knows, please look at this and fix it.  I also
have /usr/local/lib/perl5/site_perl/5.14.2/ on an OLDER FreeBSD 8.3
release with about a 4 month older Ports directory pull, and on
this newer server I DON'T have a /usr/local/lib/perl5/site_perl/5.14.4 
instead I have a /usr/local/lib/perl5/site_perl/5.14 so I don't know 
what's going on with that!?!?!?!
Comment 32 TsurutaniNaoki 2013-07-26 00:55:05 UTC
Hello,

Ted Mittelstaedt <tedm@ipinc.net> wrote:

> I have a freshly installed FreeBSD 8.4 RELEASE system with ports updated 
> about a week ago and I am still getting this error:
(snip)
> IO-Socket-INET6-2.69.tar.gz and mrtg-2.17.4.tar.gz and Perl 5.14.4 are 
> installed.

Please update all the depending ports by force.
The lines you pointed do not exist any more, I think.
Comment 33 tedm 2013-07-26 07:23:33 UTC
Sorry but I am not going to RISK destroying an entire production
server based on the word of someone who did not read my statement
that I had already updated all ports on the server, just
to see if 2 lines in a perl module will be changed.

To repeat, ALL PORTS directories on the server, not just the ones that I
installed, have been brought to the current ports tree as of July 11th.

If you can provide a link to the CVS change that occurred after July
11th 2013 which fixes this issue, then I'll take a look at it.

But until proof that the flaw has been fix is produced, all I can assume 
is that you have not even looked at the bug report and are just
making an assumption that if the complainer runs another update that it
will magically fix itself.