[mrtg] Fix conflict with Socket6

Tom Callaway spot at fedoraproject.org
Mon Nov 22 14:37:00 UTC 2010


commit a9bed4f932c5d8a306e8d175f46b24d21a6ed1e3
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Mon Nov 22 09:37:13 2010 -0500

    Fix conflict with Socket6

 mrtg-2.16.4-Socket6-fix.patch |   32 ++++++++++++++++++++++++++++++++
 mrtg.spec                     |   14 +++++++++++++-
 2 files changed, 45 insertions(+), 1 deletions(-)
---
diff --git a/mrtg-2.16.4-Socket6-fix.patch b/mrtg-2.16.4-Socket6-fix.patch
new file mode 100644
index 0000000..70c0b94
--- /dev/null
+++ b/mrtg-2.16.4-Socket6-fix.patch
@@ -0,0 +1,32 @@
+diff -up mrtg-2.16.4/bin/mrtg.BAD mrtg-2.16.4/bin/mrtg
+--- mrtg-2.16.4/bin/mrtg.BAD	2010-11-22 09:13:33.713368000 -0500
++++ mrtg-2.16.4/bin/mrtg	2010-11-22 09:14:10.503368001 -0500
+@@ -98,6 +98,7 @@ use locales_mrtg "0.07";
+ BEGIN {
+     if (eval {local $SIG{__DIE__};require Socket6;})  {
+ 	import Socket;
++	use Socket();
+ 	import Socket6
+     }    
+ }
+diff -up mrtg-2.16.4/lib/mrtg2/SNMP_Session.pm.BAD mrtg-2.16.4/lib/mrtg2/SNMP_Session.pm
+--- mrtg-2.16.4/lib/mrtg2/SNMP_Session.pm.BAD	2010-11-22 09:12:52.934368000 -0500
++++ mrtg-2.16.4/lib/mrtg2/SNMP_Session.pm	2010-11-22 09:13:26.219368002 -0500
+@@ -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));
+     }
+ }
+ 
diff --git a/mrtg.spec b/mrtg.spec
index 1c76bd4..f2d8af4 100644
--- a/mrtg.spec
+++ b/mrtg.spec
@@ -6,7 +6,7 @@
 Summary:   Multi Router Traffic Grapher
 Name:      mrtg
 Version:   2.16.4
-Release:   1%{?dist}
+Release:   2%{?dist}
 URL:       http://oss.oetiker.ch/mrtg/
 Source0:   http://oss.oetiker.ch/mrtg/pub/mrtg-%{version}.tar.gz
 Source1:   http://oss.oetiker.ch/mrtg/pub/mrtg-%{version}.tar.gz.md5
@@ -17,6 +17,14 @@ Source5:   mrtg-httpd.conf
 Source6:   filter-provides-mrtg.sh
 Patch0:    mrtg-2.15.0-lib64.patch
 Patch1:    mrtg-2.10.5-norpath.patch
+# DO NOT DROP THIS PATCH. Without it, the mrtg logs fill up with:
+# Constant subroutine SNMP_Session::AF_INET6 redefined at
+# /usr/share/perl5/Exporter.pm line 64.
+# at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 149
+# Prototype mismatch: sub SNMP_Session::AF_INET6 () vs none at
+# /usr/share/perl5/Exporter.pm line 64.
+#  at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 149
+Patch2:    mrtg-2.16.4-Socket6-fix.patch
 License:   GPLv2+
 Group:     Applications/Internet
 Requires:  vixie-cron
@@ -39,6 +47,7 @@ images which provide a LIVE visual representation of this traffic.
 %setup -q
 %patch0 -p1 -b .lib64
 %patch1 -p1
+%patch2 -p1 -b .socket6
 
 for i in doc/mrtg-forum.1 doc/mrtg-squid.1 CHANGES; do
     iconv -f iso-8859-1 -t utf-8 < "$i" > "${i}_"
@@ -112,6 +121,9 @@ rm -rf $RPM_BUILD_ROOT
 %dir %{_localstatedir}/lock/mrtg
 
 %changelog
+* Mon Nov 22 2010 Tom "spot" Callaway <tcallawa at redhat.com> - 2.16.4-2
+- resolve conflict with Socket6 (see bz 438931, 442884, 652158)
+
 * Mon Sep 27 2010 Vitezslav Crhonek <vcrhonek at redhat.com> - 2.16.4-1
 - Update to mrtg-2.16.4
 


More information about the scm-commits mailing list