diff options
author | apb <apb> | 2009-03-10 18:30:44 +0000 |
---|---|---|
committer | apb <apb> | 2009-03-10 18:30:44 +0000 |
commit | 8dcc6b86e3ff3554ec67327a4f74943687ab550a (patch) | |
tree | 96f90c16756c5a613a6d020fc17d91986da102d3 /net/net-snmp/patches/patch-ap | |
parent | 8bb9f941cbfc155967a1065c34e43bf21aa5a39a (diff) | |
download | pkgsrc-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.
Diffstat (limited to 'net/net-snmp/patches/patch-ap')
-rw-r--r-- | net/net-snmp/patches/patch-ap | 38 |
1 files changed, 38 insertions, 0 deletions
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 |