summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorapb <apb>2009-03-10 18:30:44 +0000
committerapb <apb>2009-03-10 18:30:44 +0000
commit8dcc6b86e3ff3554ec67327a4f74943687ab550a (patch)
tree96f90c16756c5a613a6d020fc17d91986da102d3
parent8bb9f941cbfc155967a1065c34e43bf21aa5a39a (diff)
downloadpkgsrc-8dcc6b86e3ff3554ec67327a4f74943687ab550a.tar.gz
Some systems define ifnet.if_lastchange as struct timespec (with
a tv_nsec field measured in nanoseconds), while other systems define it as struct timeval (with a tv_usec field measured in microseconds). Add a configure test and conditional code in agent/mibgroup/mibII/interfaces.c.orig. This should fix PR 40990. Bump PKGREVISION to 2.
-rw-r--r--net/net-snmp/Makefile4
-rw-r--r--net/net-snmp/distinfo10
-rw-r--r--net/net-snmp/patches/patch-ac12
-rw-r--r--net/net-snmp/patches/patch-af148
-rw-r--r--net/net-snmp/patches/patch-ao12
-rw-r--r--net/net-snmp/patches/patch-ap38
-rw-r--r--net/net-snmp/patches/patch-dc14
7 files changed, 225 insertions, 13 deletions
diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile
index 25d7a47c853..6436fcc1703 100644
--- a/net/net-snmp/Makefile
+++ b/net/net-snmp/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.76 2009/02/15 11:31:51 tron Exp $
+# $NetBSD: Makefile,v 1.77 2009/03/10 18:30:44 apb Exp $
DISTNAME= net-snmp-5.4.2.1
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=net-snmp/}
diff --git a/net/net-snmp/distinfo b/net/net-snmp/distinfo
index e4b0f92eb7e..d87bffb2530 100644
--- a/net/net-snmp/distinfo
+++ b/net/net-snmp/distinfo
@@ -1,14 +1,14 @@
-$NetBSD: distinfo,v 1.52 2009/02/15 11:31:51 tron Exp $
+$NetBSD: distinfo,v 1.53 2009/03/10 18:30:44 apb Exp $
SHA1 (net-snmp-5.4.2.1.tar.gz) = 4f2df9ea62344fe840f493d0e08abe5de3697862
RMD160 (net-snmp-5.4.2.1.tar.gz) = 2148c42d486ed88f9cfc3ca1d50c68abcd7e3d63
Size (net-snmp-5.4.2.1.tar.gz) = 5185390 bytes
SHA1 (patch-aa) = 34f85e513ace26c1c2b05bb1c4b72a23491861cf
SHA1 (patch-ab) = 3227eeb8b54b37813d8b6949f8c6ddc446038bf2
-SHA1 (patch-ac) = becbd7d3f7bbd16d6ddd1a6ea5467a127553caa4
+SHA1 (patch-ac) = 01969281108fc02f80f07c1974ff86e0ebb74d61
SHA1 (patch-ad) = 4af27886f93bf018f6794c3f8b8dcb9b08389163
SHA1 (patch-ae) = 721e62bb42b6d3787f36316cf2628cd71ae6a6ce
-SHA1 (patch-af) = 15a18d1a8f3a8ffaba5facb37420668791944d29
+SHA1 (patch-af) = a71f0522a1db1de0db0ec3c576635557549a327b
SHA1 (patch-ag) = 7021f7238c37635c9c32ceca681fd42aa125437f
SHA1 (patch-ah) = 9ad04b5c0046a82c4e601e4f3abb2dd491846489
SHA1 (patch-ai) = c57baca06856187115db39fd50668203dad0a94c
@@ -17,9 +17,11 @@ SHA1 (patch-ak) = cccad21d4f56e79799a433ef7bf0e8ff4e917afb
SHA1 (patch-al) = 2609e273d557e1ce06c1295d86965fe26ac7ff08
SHA1 (patch-am) = 84fc1131fb2699ab45b161a07017253e23a8ad08
SHA1 (patch-an) = 167f23c62c085efc96a25bc2be5dca3c746dde6f
+SHA1 (patch-ao) = bd50543aa52099887556cb0f0c05cf1de520a5f4
+SHA1 (patch-ap) = 2f2522fe5fd166ca7f16124f3dcfe12123762f77
SHA1 (patch-da) = 7466445c8388492344acdee236b153cb5f5b45e1
SHA1 (patch-db) = bec0bee1860ee42ba64b4c07df2280e206eaf582
-SHA1 (patch-dc) = 3f668032cbef42b44ee908b3c973af619ce0a689
+SHA1 (patch-dc) = e65f80680bc6f70d88b8722ee66ec5bf60713622
SHA1 (patch-dd) = 08da0d1da485959549ac461e5cbb7030f800e643
SHA1 (patch-de) = b505cef8542b30b3d28f5b3e61c473076e242d24
SHA1 (patch-df) = 2509d2dbf4fab3174e7719fa260505961dbbd352
diff --git a/net/net-snmp/patches/patch-ac b/net/net-snmp/patches/patch-ac
index bec7e2956b6..cc65cd382ba 100644
--- a/net/net-snmp/patches/patch-ac
+++ b/net/net-snmp/patches/patch-ac
@@ -1,6 +1,6 @@
-$NetBSD: patch-ac,v 1.7 2008/09/08 12:58:09 adam Exp $
+$NetBSD: patch-ac,v 1.8 2009/03/10 18:30:44 apb Exp $
---- configure.in.orig 2008-09-05 11:27:25.000000000 +0200
+--- configure.in.orig 2008-10-31 17:22:23.000000000 +0200
+++ configure.in
@@ -2697,6 +2697,8 @@ AC_CHECK_LIB(kstat, kstat_lookup,
AC_DEFINE(HAVE_LIBKSTAT, 1, [Define to 1 if you have the `kstat' library (-lkstat).])
@@ -134,3 +134,11 @@ $NetBSD: patch-ac,v 1.7 2008/09/08 12:58:09 adam Exp $
#include <sys/socket.h>
#undef KERNEL
#undef _KERNEL
+@@ -4162,6 +4190,7 @@ AC_CHECK_IFNET_FOR(if_noproto)
+ AC_CHECK_IFNET_FOR(if_omcasts)
+ AC_CHECK_IFNET_FOR(if_xname,no)
+ AC_CHECK_IFNET_FOR(if_lastchange.tv_sec)
++AC_CHECK_IFNET_FOR(if_lastchange.tv_nsec)
+ AC_CHECK_IFNET_FOR(if_obytes)
+ AC_CHECK_IFNET_FOR(if_ibytes)
+ AC_CHECK_IFNET_FOR(if_addrlist)
diff --git a/net/net-snmp/patches/patch-af b/net/net-snmp/patches/patch-af
index 33c6fe766b2..e9259bdbb57 100644
--- a/net/net-snmp/patches/patch-af
+++ b/net/net-snmp/patches/patch-af
@@ -1,6 +1,6 @@
-$NetBSD: patch-af,v 1.12 2008/09/08 12:58:09 adam Exp $
+$NetBSD: patch-af,v 1.13 2009/03/10 18:30:44 apb Exp $
---- configure.orig 2008-09-05 11:29:01.000000000 +0200
+--- configure.orig 2008-10-31 17:53:45.000000000 +0200
+++ configure
@@ -27854,6 +27854,81 @@ _ACEOF
fi
@@ -207,3 +207,147 @@ $NetBSD: patch-af,v 1.12 2008/09/08 12:58:09 adam Exp $
#include <sys/socket.h>
#undef KERNEL
#undef _KERNEL
+@@ -45730,6 +45831,143 @@ fi
+
+
+ ac_safe_struct=`echo "ifnet" | sed 'y%./+-%__p_%'`
++ac_safe_member=`echo "if_lastchange.tv_nsec" | sed 'y%./+-%__p_%'`
++ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}"
++ ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
++
++echo "$as_me:$LINENO: checking for ifnet.if_lastchange.tv_nsec" >&5
++echo $ECHO_N "checking for ifnet.if_lastchange.tv_nsec... $ECHO_C" >&6
++if eval "test \"\${$ac_safe_all+set}\" = set"; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++if test "x" = "x"; then
++ defineit="= 0"
++elif test "x" = "xno"; then
++ defineit=""
++else
++ defineit=""
++fi
++cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h. */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h. */
++
++
++#ifdef IFNET_NEEDS_KERNEL
++#define _KERNEL 1
++#endif
++#include <sys/types.h>
++#include <sys/socket.h>
++#ifdef HAVE_SYS_TIME_H
++#include <sys/time.h>
++#endif
++#include <net/if.h>
++#ifdef HAVE_NET_IF_VAR_H
++#include <net/if_var.h>
++#endif
++#ifdef HAVE_SYS_QUEUE_H
++#include <sys/queue.h>
++#endif
++#ifdef linux
++struct ifnet {
++ char *if_name; /* name, e.g. "en" or "lo" */
++ short if_unit; /* sub-unit for lower level driver */
++ short if_mtu; /* maximum transmission unit */
++ short if_flags; /* up/down, broadcast, etc. */
++ int if_metric; /* routing metric (external only) */
++ char if_hwaddr [6]; /* ethernet address */
++ int if_type; /* interface type: 1=generic,
++ 28=slip, ether=6, loopback=24 */
++ int if_speed; /* interface speed: in bits/sec */
++
++ struct sockaddr if_addr; /* interface's address */
++ struct sockaddr ifu_broadaddr; /* broadcast address */
++ struct sockaddr ia_subnetmask; /* interface's mask */
++
++ struct ifqueue {
++ int ifq_len;
++ int ifq_drops;
++ } if_snd; /* output queue */
++ int if_ibytes; /* octets received on interface */
++ int if_ipackets; /* packets received on interface */
++ int if_ierrors; /* input errors on interface */
++ int if_iqdrops; /* input queue overruns */
++ int if_obytes; /* octets sent on interface */
++ int if_opackets; /* packets sent on interface */
++ int if_oerrors; /* output errors on interface */
++ int if_collisions; /* collisions on csma interfaces */
++/* end statistics */
++ struct ifnet *if_next;
++};
++#endif
++
++
++int
++main ()
++{
++
++struct ifnet testit;
++testit.if_lastchange.tv_nsec $defineit;
++
++ ;
++ return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++ (eval $ac_compile) 2>conftest.er1
++ ac_status=$?
++ grep -v '^ *+' conftest.er1 >conftest.err
++ rm -f conftest.er1
++ cat conftest.err >&5
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); } &&
++ { ac_try='test -z "$ac_c_werror_flag"
++ || test ! -s conftest.err'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; } &&
++ { ac_try='test -s conftest.$ac_objext'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }; then
++ eval "${ac_safe_all}=yes"
++else
++ echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++eval "${ac_safe_all}=no"
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++
++
++if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then
++ echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++ cat >>confdefs.h <<_ACEOF
++#define $ac_uc_define 1
++_ACEOF
++
++else
++ echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++fi
++
++
++
++
++
++
++ac_safe_struct=`echo "ifnet" | sed 'y%./+-%__p_%'`
+ ac_safe_member=`echo "if_obytes" | sed 'y%./+-%__p_%'`
+ ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}"
+ ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
diff --git a/net/net-snmp/patches/patch-ao b/net/net-snmp/patches/patch-ao
new file mode 100644
index 00000000000..f4197033cff
--- /dev/null
+++ b/net/net-snmp/patches/patch-ao
@@ -0,0 +1,12 @@
+$NetBSD: patch-ao,v 1.1 2009/03/10 18:30:44 apb Exp $
+
+--- acconfig.h.orig 2008-06-05 23:11:53.000000000 +0200
++++ acconfig.h
+@@ -158,6 +158,7 @@
+ #undef STRUCT_IFNET_HAS_IF_IMCASTS
+ #undef STRUCT_IFNET_HAS_IF_IQDROPS
+ #undef STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_SEC
++#undef STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_NSEC
+ #undef STRUCT_IFNET_HAS_IF_NOPROTO
+ #undef STRUCT_IFNET_HAS_IF_OMCASTS
+ #undef STRUCT_IFNET_HAS_IF_XNAME
diff --git a/net/net-snmp/patches/patch-ap b/net/net-snmp/patches/patch-ap
new file mode 100644
index 00000000000..bd11de73439
--- /dev/null
+++ b/net/net-snmp/patches/patch-ap
@@ -0,0 +1,38 @@
+$NetBSD: patch-ap,v 1.1 2009/03/10 18:30:44 apb Exp $
+
+Some systems define ifnet.if_lastchange as struct timespec (with a
+tv_nsec field measured in nanoseconds), while other systems define it
+as struct timeval (with a tv_usec field measured in microseconds).
+Both variants have a tv_sec field for integer seconds.
+
+--- agent/mibgroup/mibII/interfaces.c.orig 2008-06-05 23:11:53.000000000 +0200
++++ agent/mibgroup/mibII/interfaces.c
+@@ -830,15 +830,25 @@ var_ifEntry(struct variable *vp,
+ * * this is fixed, thus the 199607 comparison.
+ */
+ if (ifnet.if_lastchange.tv_sec == 0 &&
+- ifnet.if_lastchange.tv_usec == 0)
++#if STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_NSEC
++ ifnet.if_lastchange.tv_nsec == 0
++#else
++ ifnet.if_lastchange.tv_usec == 0
++#endif
++ )
+ long_return = 0;
+ else if (ifnet.if_lastchange.tv_sec < starttime.tv_sec)
+ long_return = 0;
+ else {
+ long_return = (u_long)
+ ((ifnet.if_lastchange.tv_sec - starttime.tv_sec) * 100
+- + (ifnet.if_lastchange.tv_usec -
+- starttime.tv_usec) / 10000);
++ + (
++#if STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_NSEC
++ ifnet.if_lastchange.tv_nsec / 1000
++#else
++ ifnet.if_lastchange.tv_usec
++#endif
++ - starttime.tv_usec) / 10000);
+ }
+ #else
+ #if NETSNMP_NO_DUMMY_VALUES
diff --git a/net/net-snmp/patches/patch-dc b/net/net-snmp/patches/patch-dc
index 37bd5723e79..8c69a85e156 100644
--- a/net/net-snmp/patches/patch-dc
+++ b/net/net-snmp/patches/patch-dc
@@ -1,8 +1,16 @@
-$NetBSD: patch-dc,v 1.5 2008/09/08 12:58:09 adam Exp $
+$NetBSD: patch-dc,v 1.6 2009/03/10 18:30:44 apb Exp $
--- include/net-snmp/net-snmp-config.h.in.orig 2008-07-28 13:41:40.000000000 +0200
+++ include/net-snmp/net-snmp-config.h.in
-@@ -1463,6 +1463,7 @@
+@@ -159,6 +159,7 @@
+ #undef STRUCT_IFNET_HAS_IF_IMCASTS
+ #undef STRUCT_IFNET_HAS_IF_IQDROPS
+ #undef STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_SEC
++#undef STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_NSEC
+ #undef STRUCT_IFNET_HAS_IF_NOPROTO
+ #undef STRUCT_IFNET_HAS_IF_OMCASTS
+ #undef STRUCT_IFNET_HAS_IF_XNAME
+@@ -1463,6 +1464,7 @@
#define NETSNMP_HPUX11ID 14
#define NETSNMP_AIXID 15
#define NETSNMP_MACOSXID 16
@@ -10,7 +18,7 @@ $NetBSD: patch-dc,v 1.5 2008/09/08 12:58:09 adam Exp $
#define NETSNMP_UNKNOWNID 255
#ifdef hpux9
-@@ -1492,6 +1493,9 @@
+@@ -1492,6 +1494,9 @@
#if defined(__FreeBSD__)
#define NETSNMP_OSTYPE NETSNMP_FREEBSDID
#endif