From 1b839fc5687c2e025f052a56c4deabee2d37db84 Mon Sep 17 00:00:00 2001 From: "Tom \"spot\" Callaway" Date: Sun, 2 Oct 2011 13:20:59 +0200 Subject: [PATCH] resolve issue in mrtg SNMP_Session --- mrtg-2.16.4-Socket6-fix.patch | 32 ++++++++++++++++++++++++++++++++ mrtg-2.17.2-socket6-fix.patch | 21 +++++++++++++++++++++ mrtg.spec | 7 ++++++- 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 mrtg-2.16.4-Socket6-fix.patch create mode 100644 mrtg-2.17.2-socket6-fix.patch diff --git a/mrtg-2.16.4-Socket6-fix.patch b/mrtg-2.16.4-Socket6-fix.patch new file mode 100644 index 0000000..e7a2369 --- /dev/null +++ b/mrtg-2.16.4-Socket6-fix.patch @@ -0,0 +1,32 @@ +diff -up mrtg-2.16.4/bin/mrtg.orig mrtg-2.16.4/bin/mrtg +--- mrtg-2.16.4/bin/mrtg.orig 2010-12-13 14:26:25.000000000 +0100 ++++ mrtg-2.16.4/bin/mrtg 2010-12-13 14:31:30.168311050 +0100 +@@ -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.orig mrtg-2.16.4/lib/mrtg2/SNMP_Session.pm +--- mrtg-2.16.4/lib/mrtg2/SNMP_Session.pm.orig 2010-05-17 15:59:20.000000000 +0200 ++++ mrtg-2.16.4/lib/mrtg2/SNMP_Session.pm 2010-12-13 14:26:25.366152933 +0100 +@@ -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)); + } + } + diff --git a/mrtg-2.17.2-socket6-fix.patch b/mrtg-2.17.2-socket6-fix.patch new file mode 100644 index 0000000..5fd28a2 --- /dev/null +++ b/mrtg-2.17.2-socket6-fix.patch @@ -0,0 +1,21 @@ +diff -up mrtg-2.17.2/lib/mrtg2/SNMP_Session.pm.socket6 mrtg-2.17.2/lib/mrtg2/SNMP_Session.pm +--- mrtg-2.17.2/lib/mrtg2/SNMP_Session.pm.socket6 2011-02-20 23:33:38.000000000 +0100 ++++ mrtg-2.17.2/lib/mrtg2/SNMP_Session.pm 2011-10-02 13:04:28.512019418 +0200 +@@ -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");}) { +- Socket6->import(qw(pack_sockaddr_in6 inet_pton getaddrinfo)); ++ Socket6->import(qw(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; +- Socket6->import(qw(pack_sockaddr_in6 inet_pton getaddrinfo)); ++ Socket6->import(qw(inet_pton getaddrinfo)); + } + } + diff --git a/mrtg.spec b/mrtg.spec index 9bd5d06..f842616 100644 --- a/mrtg.spec +++ b/mrtg.spec @@ -6,7 +6,7 @@ Summary: Multi Router Traffic Grapher Name: mrtg Version: 2.17.2 -Release: 4%{?dist} +Release: 5%{?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 @@ -18,6 +18,7 @@ Source7: mrtg.tmpfiles Source8: mrtg.service Source9: mrtg.timer Patch0: mrtg-2.15.0-lib64.patch +Patch2: mrtg-2.17.2-socket6-fix.patch License: GPLv2+ Group: Applications/Internet Requires(post): systemd-units @@ -39,6 +40,7 @@ images which provide a LIVE visual representation of this traffic. %prep %setup -q %patch0 -p1 -b .lib64 +%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}_" @@ -131,6 +133,9 @@ fi %{_unitdir}/mrtg.timer %changelog +* Sun Oct 2 2011 Tom Callaway - 2.17.2-5 +- Resolve bugzilla 732587 + * Thu Sep 8 2011 Tom Callaway - 2.17.2-4 - add missing systemd scriptlets - drop cron.d config (systemd handles it now)