From d7c779d043349a53ff3c649fc804b952b34a574500837e294ee6d2e3d5636ebc Mon Sep 17 00:00:00 2001 From: Marcus Rueckert Date: Tue, 30 Nov 2010 23:45:31 +0000 Subject: [PATCH] Accepting request 54207 from net-snmp:factory Accepted submit request 54207 from user leonardocf OBS-URL: https://build.opensuse.org/request/show/54207 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/net-snmp?expand=0&rev=38 --- net-snmp-5.5.0-rpmdb-h-detect.patch | 12 --- net-snmp-5.6.0-ethtool-speed.patch | 102 +++++++++++++++++++++ net-snmp-5.6.0-upstream-20101101.patch.bz2 | 3 - net-snmp-5.6.0-upstream-20101129.patch.bz2 | 3 + net-snmp-5.6.0-vendorperl.patch | 13 --- net-snmp.changes | 20 ++++ net-snmp.spec | 50 +++++----- 7 files changed, 147 insertions(+), 56 deletions(-) delete mode 100644 net-snmp-5.5.0-rpmdb-h-detect.patch create mode 100644 net-snmp-5.6.0-ethtool-speed.patch delete mode 100644 net-snmp-5.6.0-upstream-20101101.patch.bz2 create mode 100644 net-snmp-5.6.0-upstream-20101129.patch.bz2 delete mode 100644 net-snmp-5.6.0-vendorperl.patch diff --git a/net-snmp-5.5.0-rpmdb-h-detect.patch b/net-snmp-5.5.0-rpmdb-h-detect.patch deleted file mode 100644 index 9342150..0000000 --- a/net-snmp-5.5.0-rpmdb-h-detect.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: net-snmp-5.5/agent/mibgroup/host/hr_swinst.c -=================================================================== ---- net-snmp-5.5.orig/agent/mibgroup/host/hr_swinst.c -+++ net-snmp-5.5/agent/mibgroup/host/hr_swinst.c -@@ -53,6 +53,7 @@ - #include - #endif - -+#define HAVE_RPM_RPMDB_H 1 - #ifdef HAVE_RPM_RPMDB_H - #include - #endif diff --git a/net-snmp-5.6.0-ethtool-speed.patch b/net-snmp-5.6.0-ethtool-speed.patch new file mode 100644 index 0000000..9a4b050 --- /dev/null +++ b/net-snmp-5.6.0-ethtool-speed.patch @@ -0,0 +1,102 @@ +From: Stephen Hemminger +Subject: if-mib: add support for more speeds with ethtool + +Change the use of Linux ethtool interface to match current +conventions used by the ethtool utility: + * allow any reported value for speed + * use ethtool conventions for speed unknown (0 or ffff) + * if device reports unknown speed, don't call MII + * support 32 bits speed data, necessary for 100G + This is newish so need to add autoconf foo to handle it. + +Submitted upstream but not yet committed: +https://sourceforge.net/tracker/?func=detail&atid=312694&aid=3057090&group_id=12694 + +--- + agent/mibgroup/if-mib/data_access/interface_linux.c | 23 ++++++++------------ + configure.d/config_os_struct_members | 11 +++++++++ + include/net-snmp/net-snmp-config.h.in | 3 ++ + 3 files changed, 24 insertions(+), 13 deletions(-) + +Index: net-snmp-5.6/agent/mibgroup/if-mib/data_access/interface_linux.c +=================================================================== +--- net-snmp-5.6.orig/agent/mibgroup/if-mib/data_access/interface_linux.c ++++ net-snmp-5.6/agent/mibgroup/if-mib/data_access/interface_linux.c +@@ -802,6 +802,7 @@ netsnmp_linux_interface_get_if_speed(int + { + struct ifreq ifr; + struct ethtool_cmd edata; ++ __u32 speed; + + memset(&ifr, 0, sizeof(ifr)); + edata.cmd = ETHTOOL_GSET; +@@ -816,24 +817,20 @@ netsnmp_linux_interface_get_if_speed(int + return netsnmp_linux_interface_get_if_speed_mii(fd,name,defaultspeed); + } + +- if (edata.speed != SPEED_10 && edata.speed != SPEED_100 +-#ifdef SPEED_10000 +- && edata.speed != SPEED_10000 ++ speed = edata.speed; ++#if HAVE_STRUCT_ETHTOOL_CMD_SPEED_HI ++ speed |= edata.speed_hi << 16; + #endif +-#ifdef SPEED_2500 +- && edata.speed != SPEED_2500 +-#endif +- && edata.speed != SPEED_1000 ) { +- DEBUGMSGTL(("mibII/interfaces", "fallback to mii for %s\n", +- ifr.ifr_name)); +- /* try MII */ +- return netsnmp_linux_interface_get_if_speed_mii(fd,name,defaultspeed); ++ if (speed == 0 || speed == (__u16)(-1) || speed == (__u32)(-1)) { ++ DEBUGMSGTL(("mibII/interfaces", "speed is not known for %s\n", ++ ifr.ifr_name)); ++ return defaultspeed; + } + + /* return in bps */ + DEBUGMSGTL(("mibII/interfaces", "ETHTOOL_GSET on %s speed = %d\n", +- ifr.ifr_name, edata.speed)); +- return edata.speed*1000LL*1000LL; ++ ifr.ifr_name, speed)); ++ return speed*1000LL*1000LL; + } + #endif + +Index: net-snmp-5.6/configure.d/config_os_struct_members +=================================================================== +--- net-snmp-5.6.orig/configure.d/config_os_struct_members ++++ net-snmp-5.6/configure.d/config_os_struct_members +@@ -33,6 +33,17 @@ AC_CHECK_MEMBERS([struct arphd.at_next], + #endif + ]]) + ++ ++# struct ethtool_cmd ++# Agent: ++if test "x$ac_cv_header_linux_ethtool_h" = "xyes" ; then ++ AC_CHECK_MEMBERS([struct ethtool_cmd.speed_hi],,,[[ ++#if HAVE_LINUX_ETHTOOL_H ++#include ++#endif ++ ]]) ++fi ++ + # struct des_ks_struct + # ('weak_key' indicates older version of OpenSSL) + # Library: +Index: net-snmp-5.6/include/net-snmp/net-snmp-config.h.in +=================================================================== +--- net-snmp-5.6.orig/include/net-snmp/net-snmp-config.h.in ++++ net-snmp-5.6/include/net-snmp/net-snmp-config.h.in +@@ -323,6 +323,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_LINUX_ETHTOOL_H + ++/* Define to 1 if `speed_hi' is member of `struct ethtool_cmd'. */ ++#undef HAVE_STRUCT_ETHTOOL_CMD_SPEED_HI ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_LINUX_HDREG_H + diff --git a/net-snmp-5.6.0-upstream-20101101.patch.bz2 b/net-snmp-5.6.0-upstream-20101101.patch.bz2 deleted file mode 100644 index 50ef28e..0000000 --- a/net-snmp-5.6.0-upstream-20101101.patch.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0057c4d33cc87a524897f9198bfa9e783fb4f41d6d682ad91e6355e77c84f6de -size 127499 diff --git a/net-snmp-5.6.0-upstream-20101129.patch.bz2 b/net-snmp-5.6.0-upstream-20101129.patch.bz2 new file mode 100644 index 0000000..af8ae58 --- /dev/null +++ b/net-snmp-5.6.0-upstream-20101129.patch.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5cb59d1f43be786a5a923d5a946226913617b0bec9473781fe798e21a0e91f6 +size 171198 diff --git a/net-snmp-5.6.0-vendorperl.patch b/net-snmp-5.6.0-vendorperl.patch deleted file mode 100644 index 52d335b..0000000 --- a/net-snmp-5.6.0-vendorperl.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: net-snmp-5.6/Makefile.in -=================================================================== ---- net-snmp-5.6.orig/Makefile.in -+++ net-snmp-5.6/Makefile.in -@@ -166,7 +166,7 @@ perlmakefiles: net-snmp-config-x - fi - - perlinstall: -- @(cd perl ; $(MAKE) install) ; \ -+ @(cd perl ; $(MAKE) install_vendor) ; \ - if test $$? != 0 ; then \ - exit 1 ; \ - fi diff --git a/net-snmp.changes b/net-snmp.changes index 694eedd..8b8dfae 100644 --- a/net-snmp.changes +++ b/net-snmp.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Tue Nov 30 18:09:58 UTC 2010 - lchiquitto@novell.com + +- remove /var/adm/perl-modules/net-snmp from the Perl module + +------------------------------------------------------------------- +Mon Nov 29 10:43:34 UTC 2010 - lchiquitto@novell.com + +- update upstream patches from branch V5-6-patches to 20101129 +- spec file cleanup: upstream uses -fno-strict-aliasing by default + now +- remove patches that are no longer needed: + net-snmp-5.5.0-rpmdb-h-detect.patch + net-snmp-5.6.0-vendorperl.patch + +------------------------------------------------------------------- +Wed Nov 3 12:04:50 UTC 2010 - lchiquitto@novell.com + +- if-mib: add support for more speeds with ethtool (bnc#650558) + ------------------------------------------------------------------- Mon Nov 1 17:54:34 UTC 2010 - lchiquitto@novell.com diff --git a/net-snmp.spec b/net-snmp.spec index e5e112b..40dbcb3 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -55,17 +55,16 @@ Source6: test_installed Source7: net-snmp.sysconfig Source8: net-snmp-rpmlintrc Source9: baselibs.conf -Patch0: net-snmp-5.6.0-upstream-20101101.patch.bz2 +Patch0: net-snmp-5.6.0-upstream-20101129.patch.bz2 # unused patch atm Patch1: net-snmp-5.5.0-socket-path.patch Patch2: net-snmp-5.5.0-testing-empty-arptable.patch Patch3: net-snmp-5.6.0-pie.patch -Patch4: net-snmp-5.6.0-vendorperl.patch Patch5: net-snmp-5.6.0-net-snmp-config-headercheck.patch Patch6: net-snmp-5.5.0-perl-tk-warning.patch Patch7: net-snmp-5.5.0-velocity-mib.patch -Patch8: net-snmp-5.5.0-rpmdb-h-detect.patch Patch9: net-snmp-5.6.0-enable-hrh-filesys.patch +Patch10: net-snmp-5.6.0-ethtool-speed.patch # Summary: SNMP Daemon @@ -204,39 +203,32 @@ Authors: %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 -%patch8 -p1 %patch9 -p1 +%patch10 -p1 %build -autoreconf -fi -# possibly add later -# --with-python-modules \ => need python-setuptools -# ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable -export CFLAGS="%{optflags} -fno-strict-aliasing -DNETSNMP_NO_INLINE" -export CFLAGS="%{optflags} -fno-strict-aliasing" -export CFLAGS="$CFLAGS -fstack-protector-all" +MIBS="misc/ipfwacc ucd-snmp/diskio etherlike-mib rmon-mib velocity smux \ + ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \ + ip-mib/ipDefaultRouterTable ip-mib/ipAddressPrefixTable \ + ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable" + +%if 0%{?netsnmp_with_sensors} +MIBS="$MIBS ucd-snmp/lmsensorsMib" +%endif + %configure \ --with-sys-contact="root@localhost" \ - --with-mib-modules="misc/ipfwacc \ - ucd-snmp/diskio \ - etherlike-mib rmon-mib \ - velocity \ -%if 0%{?netsnmp_with_sensors} - ucd-snmp/lmsensorsMib \ -%endif - smux \ - ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \ - ip-mib/ipDefaultRouterTable ip-mib/ipAddressPrefixTable \ - ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable" \ - --with-persistent-directory=/var/lib/net-snmp \ - --with-agentx-socket=%{netsnmp_agentx_socket_dir_fhs}/master \ --with-sys-location="unknown" \ - --with-logfile=%{netsnmp_logfile} \ - --with-libwrap=%{_prefix} \ + --with-mib-modules="$MIBS" \ + --with-cflags="%{optflags} -fstack-protector-all" \ + --with-persistent-directory="/var/lib/net-snmp" \ + --with-agentx-socket="%{netsnmp_agentx_socket_dir_fhs}/master" \ + --with-logfile="%{netsnmp_logfile}" \ + --with-libwrap="%{_prefix}" \ + --with-perl-modules="INSTALLDIRS=vendor" \ --with-defaults \ --enable-shared \ --disable-static \ @@ -382,7 +374,9 @@ popd %{perl_vendorarch}/auto/Bundle %{perl_vendorarch}/SNMP.pm %{perl_vendorarch}/NetSNMP -/var/adm/perl-modules/%{name} %{_bindir}/tkmib +%if 0%{?suse_version} <= 1130 +/var/adm/perl-modules/net-snmp +%endif %changelog