rpms/net-snmp/devel net-snmp-5.0.8-ipv6-sock-close.patch, 1.1, 1.2 net-snmp-5.0.8-readonly.patch, 1.1, 1.2 net-snmp-5.1.2-dir-fix.patch, 1.1, 1.2 net-snmp-5.2.1-file_offset.patch, 1.1, 1.2 net-snmp-5.3.1-multilib.patch, 1.1, 1.2 net-snmp-5.4-64bit.patch, 1.2, 1.3 net-snmp-5.4-exec-crash.patch, 1.1, 1.2 net-snmp-5.4.1-config_libdir.patch, 1.1, 1.2 net-snmp-5.4.1-hmac-check.patch, 1.1, 1.2 net-snmp-5.4.1-hostname.patch, 1.1, 1.2 net-snmp-5.4.1-perl-set.patch, 1.1, 1.2 net-snmp-5.4.1-perl-snprintf.patch, 1.1, 1.2 net-snmp-5.4.1-pie.patch, 1.1, 1.2 net-snmp-5.4.1-sensors3.patch, 1.1, 1.2 net-snmp-5.4.1-shared-ip.patch, 1.1, 1.2 net-snmp-5.4.1-strange_libpath.patch, 1.1, 1.2 net-snmp-5.4.1-xen-crash.patch, 1.1, 1.2 net-snmp.spec, 1.154, 1.155 ucd-snmp-4.2.4.pre3-mnttab.patch, 1.1, 1.2

Jan Šafránek (jsafrane) fedora-extras-commits at redhat.com
Fri Jul 25 11:04:03 UTC 2008


Author: jsafrane

Update of /cvs/pkgs/rpms/net-snmp/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23136

Modified Files:
	net-snmp-5.0.8-ipv6-sock-close.patch 
	net-snmp-5.0.8-readonly.patch net-snmp-5.1.2-dir-fix.patch 
	net-snmp-5.2.1-file_offset.patch net-snmp-5.3.1-multilib.patch 
	net-snmp-5.4-64bit.patch net-snmp-5.4-exec-crash.patch 
	net-snmp-5.4.1-config_libdir.patch 
	net-snmp-5.4.1-hmac-check.patch net-snmp-5.4.1-hostname.patch 
	net-snmp-5.4.1-perl-set.patch 
	net-snmp-5.4.1-perl-snprintf.patch net-snmp-5.4.1-pie.patch 
	net-snmp-5.4.1-sensors3.patch net-snmp-5.4.1-shared-ip.patch 
	net-snmp-5.4.1-strange_libpath.patch 
	net-snmp-5.4.1-xen-crash.patch net-snmp.spec 
	ucd-snmp-4.2.4.pre3-mnttab.patch 
Log Message:
rediff all patches to get rid of fuzz=2

net-snmp-5.0.8-ipv6-sock-close.patch:

Index: net-snmp-5.0.8-ipv6-sock-close.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.0.8-ipv6-sock-close.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.0.8-ipv6-sock-close.patch	9 Sep 2004 09:09:42 -0000	1.1
+++ net-snmp-5.0.8-ipv6-sock-close.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,6 +1,7 @@
---- net-snmp-5.0.8/agent/mibgroup/mibII/ipv6.c.orig	2003-02-25 16:35:58.000000000 +0200
-+++ net-snmp-5.0.8/agent/mibgroup/mibII/ipv6.c	2003-02-25 16:36:30.000000000 +0200
-@@ -1961,6 +1961,7 @@
+diff -up net-snmp-5.4.1/agent/mibgroup/mibII/ipv6.c.backup_patch_2 net-snmp-5.4.1/agent/mibgroup/mibII/ipv6.c
+--- net-snmp-5.4.1/agent/mibgroup/mibII/ipv6.c.backup_patch_2	2007-05-25 00:01:04.000000000 +0200
++++ net-snmp-5.4.1/agent/mibgroup/mibII/ipv6.c	2008-07-25 12:52:36.000000000 +0200
+@@ -2017,6 +2017,7 @@ var_ifv6Entry(register struct variable *
                  break;
              }
              long_return = (ifr.ifr_flags & flag) ? 1 : 2;

net-snmp-5.0.8-readonly.patch:

Index: net-snmp-5.0.8-readonly.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.0.8-readonly.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.0.8-readonly.patch	9 Sep 2004 09:09:42 -0000	1.1
+++ net-snmp-5.0.8-readonly.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,7 +1,8 @@
---- net-snmp-5.0.8/agent/snmp_agent.c.readonly	2003-08-05 14:55:44.000000000 +0200
-+++ net-snmp-5.0.8/agent/snmp_agent.c	2003-08-06 16:05:56.000000000 +0200
-@@ -1133,6 +1133,12 @@
-     int             i, n = 0, r = 0;
+diff -up net-snmp-5.4.1/agent/snmp_agent.c.backup_patch_3 net-snmp-5.4.1/agent/snmp_agent.c
+--- net-snmp-5.4.1/agent/snmp_agent.c.backup_patch_3	2007-05-14 16:50:38.000000000 +0200
++++ net-snmp-5.4.1/agent/snmp_agent.c	2008-07-25 12:52:40.000000000 +0200
+@@ -1504,6 +1504,12 @@ netsnmp_wrap_up_request(netsnmp_agent_se
+     int             i;
  
      /*
 +     * Update asp->status if necessary. Fixes ro/rw problem.

net-snmp-5.1.2-dir-fix.patch:

Index: net-snmp-5.1.2-dir-fix.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.1.2-dir-fix.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.1.2-dir-fix.patch	16 Nov 2004 08:54:28 -0000	1.1
+++ net-snmp-5.1.2-dir-fix.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,7 +1,8 @@
---- net-snmp-5.1.2/net-snmp-config.in.dir-fix	2004-06-17 15:39:28.000000000 +0200
-+++ net-snmp-5.1.2/net-snmp-config.in	2004-11-16 10:26:28.928414992 +0100
-@@ -249,7 +249,7 @@
-       echo "  " $line
+diff -up net-snmp-5.4.1/net-snmp-config.in.backup_patch_6 net-snmp-5.4.1/net-snmp-config.in
+--- net-snmp-5.4.1/net-snmp-config.in.backup_patch_6	2007-06-30 00:18:27.000000000 +0200
++++ net-snmp-5.4.1/net-snmp-config.in	2008-07-25 12:53:19.000000000 +0200
+@@ -302,7 +302,7 @@ else
+       fi
        echo $line >> $outfile
  
 -      outfile="@datadir@/snmp/snmpd.conf"

net-snmp-5.2.1-file_offset.patch:

Index: net-snmp-5.2.1-file_offset.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.2.1-file_offset.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.2.1-file_offset.patch	4 Apr 2005 08:11:17 -0000	1.1
+++ net-snmp-5.2.1-file_offset.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,17 +1,7 @@
---- net-snmp-5.2.1/include/net-snmp/agent/snmp_vars.h.long	2004-04-15 14:47:10.000000000 +0200
-+++ net-snmp-5.2.1/include/net-snmp/agent/snmp_vars.h	2005-03-21 17:03:29.909271960 +0100
-@@ -73,7 +73,7 @@
- 
-     struct nlist;
- 
--    extern long     long_return;
-+    extern fsblkcnt_t long_return;
-     extern u_char   return_buf[];
- 
-     extern oid      nullOid[];
---- net-snmp-5.2.1/agent/mibgroup/host/hr_filesys.c.long	2004-06-19 15:34:11.000000000 +0200
-+++ net-snmp-5.2.1/agent/mibgroup/host/hr_filesys.c	2005-03-21 17:03:29.910271808 +0100
-@@ -773,7 +773,7 @@
+diff -up net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.c.backup_patch_7 net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.c
+--- net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.c.backup_patch_7	2007-05-18 20:08:01.000000000 +0200
++++ net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.c	2008-07-25 12:53:28.000000000 +0200
+@@ -911,7 +911,7 @@ Get_FSIndex(char *dev)
      return 0;
  }
  
@@ -20,9 +10,10 @@
  Get_FSSize(char *dev)
  {
      struct HRFS_statfs statfs_buf;
---- net-snmp-5.2.1/agent/mibgroup/host/hr_filesys.h.long	2002-07-04 14:56:35.000000000 +0200
-+++ net-snmp-5.2.1/agent/mibgroup/host/hr_filesys.h	2005-03-21 17:03:29.910271808 +0100
-@@ -12,7 +12,7 @@
+diff -up net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.h.backup_patch_7 net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.h
+--- net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.h.backup_patch_7	2002-07-04 14:58:04.000000000 +0200
++++ net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.h	2008-07-25 12:53:28.000000000 +0200
+@@ -12,7 +12,7 @@ extern int      Get_Next_HR_FileSys(void
  extern int      Check_HR_FileSys_NFS(void);
  
  extern int      Get_FSIndex(char *);
@@ -31,9 +22,10 @@
  
  
  #endif                          /* _MIBGROUP_HRFSYS_H */
---- net-snmp-5.2.1/agent/snmp_vars.c.long	2005-03-21 17:08:37.790466904 +0100
-+++ net-snmp-5.2.1/agent/snmp_vars.c	2005-03-21 17:08:37.790466904 +0100
-@@ -223,7 +223,7 @@
+diff -up net-snmp-5.4.1/agent/snmp_vars.c.backup_patch_7 net-snmp-5.4.1/agent/snmp_vars.c
+--- net-snmp-5.4.1/agent/snmp_vars.c.backup_patch_7	2006-09-15 02:48:50.000000000 +0200
++++ net-snmp-5.4.1/agent/snmp_vars.c	2008-07-25 12:53:28.000000000 +0200
+@@ -224,7 +224,7 @@ extern netsnmp_subtree *subtrees;
   * int      name_len        IN - number of sub-ids in the name
   */
  
@@ -42,3 +34,15 @@
  #ifndef ibm032
  u_char          return_buf[258];
  #else
+diff -up net-snmp-5.4.1/include/net-snmp/agent/snmp_vars.h.backup_patch_7 net-snmp-5.4.1/include/net-snmp/agent/snmp_vars.h
+--- net-snmp-5.4.1/include/net-snmp/agent/snmp_vars.h.backup_patch_7	2005-06-21 23:33:55.000000000 +0200
++++ net-snmp-5.4.1/include/net-snmp/agent/snmp_vars.h	2008-07-25 12:53:28.000000000 +0200
+@@ -73,7 +73,7 @@ PERFORMANCE OF THIS SOFTWARE.
+ 
+     struct nlist;
+ 
+-    extern long     long_return;
++    extern fsblkcnt_t long_return;
+     extern u_char   return_buf[];
+ 
+     extern oid      nullOid[];

net-snmp-5.3.1-multilib.patch:

Index: net-snmp-5.3.1-multilib.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.3.1-multilib.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.3.1-multilib.patch	23 May 2006 09:04:55 -0000	1.1
+++ net-snmp-5.3.1-multilib.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,6 +1,7 @@
---- net-snmp-5.3.1.pre2/man/read_config.3.def.old	2003-04-25 16:02:55.000000000 +0200
-+++ net-snmp-5.3.1.pre2/man/read_config.3.def	2006-05-23 09:41:35.000000000 +0200
-@@ -257,7 +257,7 @@
+diff -up net-snmp-5.4.1/man/read_config.3.def.backup_patch_8 net-snmp-5.4.1/man/read_config.3.def
+--- net-snmp-5.4.1/man/read_config.3.def.backup_patch_8	2003-04-25 16:02:55.000000000 +0200
++++ net-snmp-5.4.1/man/read_config.3.def	2008-07-25 12:53:34.000000000 +0200
+@@ -257,7 +257,7 @@ The configuration files read are found b
  .I SNMPCONFPATH
  environment variable (or its default value, which will be
  SYSCONFDIR/snmp, followed by
@@ -9,7 +10,7 @@
  reading in the files found that match both the prefix registered and
  the two suffixes
  .I .conf
-@@ -285,7 +285,7 @@
+@@ -285,7 +285,7 @@ function that it should abort the operat
  SNMPCONFPATH
  A colon separated list of directories to search for configuration
  files in.

net-snmp-5.4-64bit.patch:

Index: net-snmp-5.4-64bit.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4-64bit.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- net-snmp-5.4-64bit.patch	14 Feb 2008 11:56:20 -0000	1.2
+++ net-snmp-5.4-64bit.patch	25 Jul 2008 11:03:32 -0000	1.3
@@ -1,62 +1,7 @@
---- net-snmp-5.4/agent/mibgroup/ucd-snmp/pass_persist.c.64bit	2006-10-18 04:59:10.000000000 +0200
-+++ net-snmp-5.4/agent/mibgroup/ucd-snmp/pass_persist.c	2006-11-27 13:56:30.000000000 +0100
-@@ -218,6 +218,7 @@
-     oid             newname[MAX_OID_LEN];
-     int             i, rtest, newlen;
-     static long     long_ret;
-+    static in_addr_t addr_ret;
-     char            buf[SNMP_MAXBUF];
-     static char     buf2[SNMP_MAXBUF];
-     static oid      objid[MAX_OID_LEN];
-@@ -366,13 +367,13 @@
-                         *var_len = 0;
-                         return (NULL);
-                     }
--                    long_ret =
-+                    addr_ret =
-                         (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
-                         (objid[2] << 8) + objid[3];
--                    long_ret = htonl(long_ret);
--                    *var_len = sizeof(long_ret);
-+                    addr_ret = htonl(addr_ret);
-+                    *var_len = sizeof(addr_ret);
-                     vp->type = ASN_IPADDRESS;
--                    return ((unsigned char *) &long_ret);
-+                    return ((unsigned char *) &addr_ret);
-                 }
-             }
-             *var_len = 0;
---- net-snmp-5.4/agent/mibgroup/ucd-snmp/pass.c.64bit	2005-08-18 02:44:02.000000000 +0200
-+++ net-snmp-5.4/agent/mibgroup/ucd-snmp/pass.c	2006-11-27 13:56:30.000000000 +0100
-@@ -287,6 +287,7 @@
-     oid             newname[MAX_OID_LEN];
-     int             i, rtest, fd, newlen;
-     static long     long_ret;
-+    static in_addr_t addr_ret;
-     char            buf[SNMP_MAXBUF];
-     static char     buf2[SNMP_MAXBUF];
-     static oid      objid[MAX_OID_LEN];
-@@ -412,13 +413,13 @@
-                         *var_len = 0;
-                         return (NULL);
-                     }
--                    long_ret =
-+                    addr_ret =
-                         (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
-                         (objid[2] << 8) + objid[3];
--                    long_ret = htonl(long_ret);
--                    *var_len = sizeof(long_ret);
-+                    addr_ret = htonl(addr_ret);
-+                    *var_len = sizeof(addr_ret);
-                     vp->type = ASN_IPADDRESS;
--                    return ((unsigned char *) &long_ret);
-+                    return ((unsigned char *) &addr_ret);
-                 }
-             }
-             *var_len = 0;
---- net-snmp-5.4/agent/mibgroup/mibII/at.c.64bit	2006-11-07 00:43:27.000000000 +0100
-+++ net-snmp-5.4/agent/mibgroup/mibII/at.c	2006-11-27 13:59:46.000000000 +0100
-@@ -126,9 +126,9 @@
+diff -up net-snmp-5.4.1/agent/mibgroup/mibII/at.c.backup_patch_5 net-snmp-5.4.1/agent/mibgroup/mibII/at.c
+--- net-snmp-5.4.1/agent/mibgroup/mibII/at.c.backup_patch_5	2006-12-27 20:17:49.000000000 +0100
++++ net-snmp-5.4.1/agent/mibgroup/mibII/at.c	2008-07-25 12:53:03.000000000 +0200
+@@ -128,9 +128,9 @@
  #ifndef solaris2
  static void     ARP_Scan_Init(void);
  #ifdef ARP_SCAN_FOUR_ARGUMENTS
@@ -68,7 +13,7 @@
  #endif
  #endif
  #endif
-@@ -204,7 +204,8 @@
+@@ -206,7 +206,8 @@ var_atEntry(struct variable *vp,
      oid             lowest[16];
      oid             current[16];
      static char     PhysAddr[6], LowPhysAddr[6];
@@ -78,7 +23,7 @@
  #ifdef ARP_SCAN_FOUR_ARGUMENTS
      u_short         ifIndex, lowIfIndex = 0;
  #endif                          /* ARP_SCAN_FOUR_ARGUMENTS */
-@@ -314,9 +315,9 @@
+@@ -316,9 +317,9 @@ var_atEntry(struct variable *vp,
          *var_len = sizeof(LowPhysAddr);
          return (u_char *) LowPhysAddr;
      case IPMEDIANETADDRESS:    /* also ATNETADDRESS */
@@ -91,7 +36,7 @@
      case IPMEDIATYPE:
          *var_len = sizeof long_return;
          long_return = lowIfType;
-@@ -707,11 +708,11 @@
+@@ -709,11 +710,11 @@ ARP_Scan_Init(void)
  
  #ifdef ARP_SCAN_FOUR_ARGUMENTS
  static int
@@ -105,9 +50,59 @@
  #endif
  {
  #ifndef NETSNMP_CAN_USE_SYSCTL
---- net-snmp-5.4/agent/mibgroup/mibII/var_route.c.64bit	2006-11-07 00:43:27.000000000 +0100
-+++ net-snmp-5.4/agent/mibgroup/mibII/var_route.c	2006-11-27 14:13:13.000000000 +0100
-@@ -434,6 +434,7 @@
+diff -up net-snmp-5.4.1/agent/mibgroup/mibII/ipCidrRouteTable_access.c.backup_patch_5 net-snmp-5.4.1/agent/mibgroup/mibII/ipCidrRouteTable_access.c
+--- net-snmp-5.4.1/agent/mibgroup/mibII/ipCidrRouteTable_access.c.backup_patch_5	2003-02-22 05:19:51.000000000 +0100
++++ net-snmp-5.4.1/agent/mibgroup/mibII/ipCidrRouteTable_access.c	2008-07-25 12:53:03.000000000 +0200
+@@ -22,6 +22,7 @@
+ /** a global static we'll make use of a lot to map to the right
+    datatype to return (which for SNMP integer's is always a long). */
+ static u_long long_ret;
++static in_addr_t addr_ret;
+   
+ 
+ /*
+@@ -32,18 +33,18 @@ u_long         *
+ get_ipCidrRouteDest(void *data_context, size_t * ret_len)
+ {
+     RTENTRY *ourroute = (RTENTRY *) data_context;
+-    long_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr;
+-    *ret_len = sizeof(long_ret);
+-    return &long_ret;
++    addr_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr;
++    *ret_len = sizeof(addr_ret);
++    return &addr_ret;
+ }
+ 
+ u_long         *
+ get_ipCidrRouteMask(void *data_context, size_t * ret_len)
+ {
+     RTENTRY *ourroute = (RTENTRY *) data_context;
+-    long_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr;
+-    *ret_len = sizeof(long_ret);
+-    return &long_ret;
++    addr_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr;
++    *ret_len = sizeof(addr_ret);
++    return &addr_ret;
+ }
+ 
+ long           *
+@@ -59,9 +60,9 @@ u_long         *
+ get_ipCidrRouteNextHop(void *data_context, size_t * ret_len)
+ {
+     RTENTRY *ourroute = (RTENTRY *) data_context;
+-    long_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr;
+-    *ret_len = sizeof(long_ret);
+-    return &long_ret;
++    addr_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr;
++    *ret_len = sizeof(addr_ret);
++    return &addr_ret;
+ }
+ 
+ long           *
+diff -up net-snmp-5.4.1/agent/mibgroup/mibII/var_route.c.backup_patch_5 net-snmp-5.4.1/agent/mibgroup/mibII/var_route.c
+--- net-snmp-5.4.1/agent/mibgroup/mibII/var_route.c.backup_patch_5	2006-11-07 00:43:27.000000000 +0100
++++ net-snmp-5.4.1/agent/mibgroup/mibII/var_route.c	2008-07-25 12:53:03.000000000 +0200
+@@ -434,6 +434,7 @@ var_ipRouteEntry(struct variable * vp,
      static oid      saveName[MAX_OID_LEN], Current[MAX_OID_LEN];
      u_char         *cp;
      oid            *op;
@@ -115,7 +110,7 @@
  #if NEED_KLGETSA
      struct sockaddr_in *sa;
  #endif
-@@ -538,13 +539,13 @@
+@@ -538,13 +539,13 @@ var_ipRouteEntry(struct variable * vp,
  
      switch (vp->magic) {
      case IPROUTEDEST:
@@ -132,7 +127,7 @@
  #else
          return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]->
                               rt_dst)->sin_addr.s_addr;
-@@ -597,13 +598,13 @@
+@@ -597,13 +598,13 @@ var_ipRouteEntry(struct variable * vp,
          long_return = -1;
          return (u_char *) & long_return;
      case IPROUTENEXTHOP:
@@ -149,7 +144,7 @@
  #else
          return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]->
                               rt_gateway)->sin_addr.s_addr;
-@@ -649,14 +650,14 @@
+@@ -649,14 +650,14 @@ var_ipRouteEntry(struct variable * vp,
  #if NETSNMP_NO_DUMMY_VALUES
          return NULL;
  #endif
@@ -168,7 +163,7 @@
          else {
  #ifndef linux
              if (!NETSNMP_KLOOKUP(rthead[RtIndex]->rt_ifp,
-@@ -681,7 +682,7 @@
+@@ -681,7 +682,7 @@ var_ipRouteEntry(struct variable * vp,
  #endif                          /* linux */
          }
  #endif                          /* NEED_KLGETSA */
@@ -177,51 +172,61 @@
      case IPROUTEINFO:
          *var_len = nullOidLen;
          return (u_char *) nullOid;
---- net-snmp-5.4/agent/mibgroup/mibII/ipCidrRouteTable_access.c.64bit	2003-02-22 05:19:51.000000000 +0100
-+++ net-snmp-5.4/agent/mibgroup/mibII/ipCidrRouteTable_access.c	2006-11-27 13:56:30.000000000 +0100
-@@ -22,6 +22,7 @@
- /** a global static we'll make use of a lot to map to the right
-    datatype to return (which for SNMP integer's is always a long). */
- static u_long long_ret;
-+static in_addr_t addr_ret;
-   
- 
- /*
-@@ -32,18 +33,18 @@
- get_ipCidrRouteDest(void *data_context, size_t * ret_len)
- {
-     RTENTRY *ourroute = (RTENTRY *) data_context;
--    long_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr;
--    *ret_len = sizeof(long_ret);
--    return &long_ret;
-+    addr_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr;
-+    *ret_len = sizeof(addr_ret);
-+    return &addr_ret;
- }
- 
- u_long         *
- get_ipCidrRouteMask(void *data_context, size_t * ret_len)
- {
-     RTENTRY *ourroute = (RTENTRY *) data_context;
--    long_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr;
--    *ret_len = sizeof(long_ret);
--    return &long_ret;
-+    addr_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr;
-+    *ret_len = sizeof(addr_ret);
-+    return &addr_ret;
- }
- 
- long           *
-@@ -59,9 +60,9 @@
- get_ipCidrRouteNextHop(void *data_context, size_t * ret_len)
- {
-     RTENTRY *ourroute = (RTENTRY *) data_context;
--    long_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr;
--    *ret_len = sizeof(long_ret);
--    return &long_ret;
-+    addr_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr;
-+    *ret_len = sizeof(addr_ret);
-+    return &addr_ret;
- }
- 
- long           *
+diff -up net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass.c.backup_patch_5 net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass.c
+--- net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass.c.backup_patch_5	2005-08-18 02:44:02.000000000 +0200
++++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass.c	2008-07-25 12:53:03.000000000 +0200
+@@ -287,6 +287,7 @@ var_extensible_pass(struct variable *vp,
+     oid             newname[MAX_OID_LEN];
+     int             i, rtest, fd, newlen;
+     static long     long_ret;
++    static in_addr_t addr_ret;
+     char            buf[SNMP_MAXBUF];
+     static char     buf2[SNMP_MAXBUF];
+     static oid      objid[MAX_OID_LEN];
+@@ -412,13 +413,13 @@ var_extensible_pass(struct variable *vp,
+                         *var_len = 0;
+                         return (NULL);
+                     }
+-                    long_ret =
++                    addr_ret =
+                         (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
+                         (objid[2] << 8) + objid[3];
+-                    long_ret = htonl(long_ret);
+-                    *var_len = sizeof(long_ret);
++                    addr_ret = htonl(addr_ret);
++                    *var_len = sizeof(addr_ret);
+                     vp->type = ASN_IPADDRESS;
+-                    return ((unsigned char *) &long_ret);
++                    return ((unsigned char *) &addr_ret);
+                 }
+             }
+             *var_len = 0;
+diff -up net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass_persist.c.backup_patch_5 net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass_persist.c
+--- net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass_persist.c.backup_patch_5	2006-10-18 04:59:10.000000000 +0200
++++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/pass_persist.c	2008-07-25 12:53:03.000000000 +0200
+@@ -218,6 +218,7 @@ var_extensible_pass_persist(struct varia
+     oid             newname[MAX_OID_LEN];
+     int             i, rtest, newlen;
+     static long     long_ret;
++    static in_addr_t addr_ret;
+     char            buf[SNMP_MAXBUF];
+     static char     buf2[SNMP_MAXBUF];
+     static oid      objid[MAX_OID_LEN];
+@@ -366,13 +367,13 @@ var_extensible_pass_persist(struct varia
+                         *var_len = 0;
+                         return (NULL);
+                     }
+-                    long_ret =
++                    addr_ret =
+                         (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
+                         (objid[2] << 8) + objid[3];
+-                    long_ret = htonl(long_ret);
+-                    *var_len = sizeof(long_ret);
++                    addr_ret = htonl(addr_ret);
++                    *var_len = sizeof(addr_ret);
+                     vp->type = ASN_IPADDRESS;
+-                    return ((unsigned char *) &long_ret);
++                    return ((unsigned char *) &addr_ret);
+                 }
+             }
+             *var_len = 0;

net-snmp-5.4-exec-crash.patch:

Index: net-snmp-5.4-exec-crash.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4-exec-crash.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4-exec-crash.patch	28 Jun 2007 08:56:14 -0000	1.1
+++ net-snmp-5.4-exec-crash.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,6 +1,7 @@
---- net-snmp-5.4/agent/mibgroup/agent/extend.c.orig	2006-10-18 21:07:35.000000000 +0200
-+++ net-snmp-5.4/agent/mibgroup/agent/extend.c	2007-06-27 14:30:08.000000000 +0200
-@@ -448,6 +448,9 @@
+diff -up net-snmp-5.4.1/agent/mibgroup/agent/extend.c.backup_patch_14 net-snmp-5.4.1/agent/mibgroup/agent/extend.c
+--- net-snmp-5.4.1/agent/mibgroup/agent/extend.c.backup_patch_14	2007-07-06 17:32:59.000000000 +0200
++++ net-snmp-5.4.1/agent/mibgroup/agent/extend.c	2008-07-25 12:53:44.000000000 +0200
+@@ -450,6 +450,9 @@ extend_parse_config(const char *token, c
          extension->command  = strdup( exec_command );
          if (cptr)
              extension->args = strdup( cptr );

net-snmp-5.4.1-config_libdir.patch:

Index: net-snmp-5.4.1-config_libdir.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4.1-config_libdir.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4.1-config_libdir.patch	7 Aug 2007 12:33:35 -0000	1.1
+++ net-snmp-5.4.1-config_libdir.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,6 +1,7 @@
---- net-snmp-5.4/configure.libdir	2006-11-27 14:27:52.000000000 +0100
-+++ net-snmp-5.4/configure	2006-11-27 14:31:34.000000000 +0100
-@@ -5161,7 +5161,7 @@
+diff -up net-snmp-5.4.1/configure.backup_patch_9 net-snmp-5.4.1/configure
+--- net-snmp-5.4.1/configure.backup_patch_9	2008-07-25 12:52:01.000000000 +0200
++++ net-snmp-5.4.1/configure	2008-07-25 12:53:35.000000000 +0200
+@@ -5252,7 +5252,7 @@ freebsd* | dragonfly*)
        # Let's accept both of them until this is cleared up.
        lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
        lt_cv_file_magic_cmd=/usr/bin/file
@@ -9,7 +10,7 @@
        ;;
      esac
    else
-@@ -5178,15 +5178,15 @@
+@@ -5269,15 +5269,15 @@ hpux10.20* | hpux11*)
    case $host_cpu in
    ia64*)
      lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
@@ -28,7 +29,7 @@
      ;;
    esac
    ;;
-@@ -5222,7 +5222,7 @@
+@@ -5313,7 +5313,7 @@ netbsd*)
  newos6*)
    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
    lt_cv_file_magic_cmd=/usr/bin/file
@@ -37,7 +38,7 @@
    ;;
  
  nto-qnx*)
-@@ -5249,7 +5249,7 @@
+@@ -5344,7 +5344,7 @@ sysv4 | sysv4.3*)
    case $host_vendor in
    motorola)
      lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
@@ -46,7 +47,7 @@
      ;;
    ncr)
      lt_cv_deplibs_check_method=pass_all
-@@ -8761,13 +8761,13 @@
+@@ -8905,13 +8905,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
  fi
  rm -f conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
@@ -62,7 +63,7 @@
  	  allow_undefined_flag="-z nodefs"
  	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
  	else
-@@ -8822,7 +8822,7 @@
+@@ -8973,7 +8973,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
  fi
  rm -f conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
@@ -71,7 +72,7 @@
  
  	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
  	  # Warning - without using the other run time loading flags,
-@@ -8936,7 +8936,7 @@
+@@ -9087,7 +9087,7 @@ if test -z "$aix_libpath"; then aix_libp
      # does not break anything, and helps significantly (at the cost of a little
      # extra space).
      freebsd2.2*)
@@ -80,18 +81,18 @@
        hardcode_libdir_flag_spec='-R$libdir'
        hardcode_direct=yes
        hardcode_shlibpath_var=no
-@@ -9504,7 +9504,7 @@
+@@ -9504,7 +9504,7 @@ shlibpath_var=
  shlibpath_overrides_runpath=unknown
  version_type=none
  dynamic_linker="$host_os ld.so"
 -sys_lib_dlsearch_path_spec="/lib /usr/lib"
 +sys_lib_dlsearch_path_spec="/lib $LIBDIR"
-
+ 
  if test "$GCC" = yes; then
    case $host_os in
-@@ -9363,7 +9363,7 @@
-     sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-   fi
+@@ -9555,7 +9555,7 @@ BEGIN {RS=" "; FS="/|\n";} {
+ }'`
+   sys_lib_search_path_spec=`echo $lt_search_path_spec`
  else
 -  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 +  sys_lib_search_path_spec="/lib $LIBDIR /usr/local/lib"

net-snmp-5.4.1-hmac-check.patch:

Index: net-snmp-5.4.1-hmac-check.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4.1-hmac-check.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4.1-hmac-check.patch	10 Jun 2008 06:02:57 -0000	1.1
+++ net-snmp-5.4.1-hmac-check.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -4,9 +4,10 @@
 Reviewed-by: Jan Safranek <jsafrane at redhat.com>
 
 diff -up net-snmp-5.0.9/snmplib/scapi.c.orig net-snmp-5.0.9/snmplib/scapi.c
---- net-snmp-5.0.9/snmplib/scapi.c.orig	2008-06-04 10:19:26.000000000 +0200
-+++ net-snmp-5.0.9/snmplib/scapi.c	2008-06-04 10:20:45.000000000 +0200
-@@ -460,6 +460,9 @@ sc_check_keyed_hash(const oid * authtype
+diff -up net-snmp-5.4.1/snmplib/scapi.c.backup_patch_17 net-snmp-5.4.1/snmplib/scapi.c
+--- net-snmp-5.4.1/snmplib/scapi.c.backup_patch_17	2006-09-15 14:47:01.000000000 +0200
++++ net-snmp-5.4.1/snmplib/scapi.c	2008-07-25 12:54:00.000000000 +0200
+@@ -562,6 +562,9 @@ sc_check_keyed_hash(const oid * authtype
          QUITFUN(SNMPERR_GENERR, sc_check_keyed_hash_quit);
      }
  

net-snmp-5.4.1-hostname.patch:

Index: net-snmp-5.4.1-hostname.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4.1-hostname.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4.1-hostname.patch	7 Aug 2007 12:33:35 -0000	1.1
+++ net-snmp-5.4.1-hostname.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,36 +1,6 @@
---- net-snmp-5.4/snmplib/snmpUDPDomain.c.orig	2006-09-20 01:42:17.000000000 +0200
-+++ net-snmp-5.4/snmplib/snmpUDPDomain.c	2007-05-03 12:17:30.000000000 +0200
-@@ -87,6 +87,7 @@
- netsnmp_udp_fmtaddr(netsnmp_transport *t, void *data, int len)
- {
-     netsnmp_udp_addr_pair *addr_pair = NULL;
-+    struct hostent *host;
- 
-     if (data != NULL && len == sizeof(netsnmp_udp_addr_pair)) {
- 	addr_pair = (netsnmp_udp_addr_pair *) data;
-@@ -104,6 +105,10 @@
-             return strdup("UDP: unknown");
-         }
- 
-+        if ( t && t->flags & NETSNMP_TRANSPORT_FLAG_HOSTNAME ) {
-+            host = gethostbyaddr((char *)&to->sin_addr, 4, AF_INET);
-+            return (host ? strdup(host->h_name) : NULL);
-+        }
-         sprintf(tmp, "UDP: [%s]:%hu",
-                 inet_ntoa(to->sin_addr), ntohs(to->sin_port));
-         return strdup(tmp);
---- net-snmp-5.3.1/include/net-snmp/library/snmp_transport.h.orig	2005-09-15 15:46:58.000000000 +0200
-+++ net-snmp-5.3.1/include/net-snmp/library/snmp_transport.h	2007-05-02 17:21:30.000000000 +0200
-@@ -19,6 +19,7 @@
- #define		NETSNMP_TRANSPORT_FLAG_STREAM	0x01
- #define		NETSNMP_TRANSPORT_FLAG_LISTEN	0x02
- #define		NETSNMP_TRANSPORT_FLAG_TUNNELED	0x04
-+#define 	NETSNMP_TRANSPORT_FLAG_HOSTNAME 0x80  /* for fmtaddr hook */
- 
- /*  The standard SNMP domains.  */
- 
---- net-snmp-5.4.1/apps/snmptrapd_log.c.orig	2007-05-31 16:39:14.000000000 +0200
-+++ net-snmp-5.4.1/apps/snmptrapd_log.c	2007-08-07 13:46:40.000000000 +0200
+diff -up net-snmp-5.4.1/apps/snmptrapd_log.c.backup_patch_12 net-snmp-5.4.1/apps/snmptrapd_log.c
+--- net-snmp-5.4.1/apps/snmptrapd_log.c.backup_patch_12	2007-05-31 16:39:14.000000000 +0200
++++ net-snmp-5.4.1/apps/snmptrapd_log.c	2008-07-25 12:53:41.000000000 +0200
 @@ -626,6 +626,8 @@ realloc_handle_ip_fmt(u_char ** buf, siz
      char            fmt_cmd = options->cmd;     /* what we're formatting */
      u_char         *temp_buf = NULL;
@@ -210,3 +180,36 @@
                  return 0;
              }
          }
+diff -up net-snmp-5.4.1/include/net-snmp/library/snmp_transport.h.backup_patch_12 net-snmp-5.4.1/include/net-snmp/library/snmp_transport.h
+--- net-snmp-5.4.1/include/net-snmp/library/snmp_transport.h.backup_patch_12	2006-10-27 22:19:44.000000000 +0200
++++ net-snmp-5.4.1/include/net-snmp/library/snmp_transport.h	2008-07-25 12:53:41.000000000 +0200
+@@ -19,6 +19,7 @@ extern          "C" {
+ #define		NETSNMP_TRANSPORT_FLAG_STREAM	0x01
+ #define		NETSNMP_TRANSPORT_FLAG_LISTEN	0x02
+ #define		NETSNMP_TRANSPORT_FLAG_TUNNELED	0x04
++#define 	NETSNMP_TRANSPORT_FLAG_HOSTNAME 0x80  /* for fmtaddr hook */
+ 
+ /*  The standard SNMP domains.  */
+ 
+diff -up net-snmp-5.4.1/snmplib/snmpUDPDomain.c.backup_patch_12 net-snmp-5.4.1/snmplib/snmpUDPDomain.c
+--- net-snmp-5.4.1/snmplib/snmpUDPDomain.c.backup_patch_12	2007-06-11 00:15:24.000000000 +0200
++++ net-snmp-5.4.1/snmplib/snmpUDPDomain.c	2008-07-25 12:53:41.000000000 +0200
+@@ -90,6 +90,7 @@ static char *
+ netsnmp_udp_fmtaddr(netsnmp_transport *t, void *data, int len)
+ {
+     netsnmp_udp_addr_pair *addr_pair = NULL;
++    struct hostent *host;
+ 
+     if (data != NULL && len == sizeof(netsnmp_udp_addr_pair)) {
+ 	addr_pair = (netsnmp_udp_addr_pair *) data;
+@@ -107,6 +108,10 @@ netsnmp_udp_fmtaddr(netsnmp_transport *t
+             return strdup("UDP: unknown");
+         }
+ 
++        if ( t && t->flags & NETSNMP_TRANSPORT_FLAG_HOSTNAME ) {
++            host = gethostbyaddr((char *)&to->sin_addr, 4, AF_INET);
++            return (host ? strdup(host->h_name) : NULL);
++        }
+         sprintf(tmp, "UDP: [%s]:%hu",
+                 inet_ntoa(to->sin_addr), ntohs(to->sin_port));
+         return strdup(tmp);

net-snmp-5.4.1-perl-set.patch:

Index: net-snmp-5.4.1-perl-set.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4.1-perl-set.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4.1-perl-set.patch	22 Jul 2008 07:46:49 -0000	1.1
+++ net-snmp-5.4.1-perl-set.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -3,9 +3,10 @@
 Source: jbjohnso at us.ibm.com, accepted upstream, SVN rev. 17097
 
 diff -urN net-snmp-5.4.1/perl/SNMP/SNMP.xs net-snmp-5.4.1-f9fix/perl/SNMP/SNMP.xs
---- net-snmp-5.4.1/perl/SNMP/SNMP.xs	2008-06-13 15:48:46.000000000 -0500
-+++ net-snmp-5.4.1-f9fix/perl/SNMP/SNMP.xs	2008-06-13 15:48:05.000000000 -0500
-@@ -3072,7 +3072,7 @@
+diff -up net-snmp-5.4.1/perl/SNMP/SNMP.xs.backup_patch_19 net-snmp-5.4.1/perl/SNMP/SNMP.xs
+--- net-snmp-5.4.1/perl/SNMP/SNMP.xs.backup_patch_19	2008-07-25 12:54:02.000000000 +0200
++++ net-snmp-5.4.1/perl/SNMP/SNMP.xs	2008-07-25 12:54:05.000000000 +0200
+@@ -3072,7 +3072,7 @@ snmp_set(sess_ref, varlist_ref, perl_cal
                      res = __add_var_val_str(pdu, oid_arr, oid_arr_len,
  				     (varbind_val_f && SvOK(*varbind_val_f) ?
  				      SvPV(*varbind_val_f,na):NULL),
@@ -14,7 +15,7 @@
  				       SvCUR(*varbind_val_f):0), type);
  
  		    if (verbose && res == FAILURE)
-@@ -4266,7 +4266,7 @@
+@@ -4266,7 +4266,7 @@ snmp_trapV1(sess_ref,enterprise,agent,ge
                      res = __add_var_val_str(pdu, oid_arr, oid_arr_len,
                                    (varbind_val_f && SvOK(*varbind_val_f) ?
                                     SvPV(*varbind_val_f,na):NULL),
@@ -23,7 +24,7 @@
                                     SvCUR(*varbind_val_f):0),
                                    type);
  
-@@ -4424,7 +4424,7 @@
+@@ -4424,7 +4424,7 @@ snmp_trapV2(sess_ref,uptime,trap_oid,var
                      res = __add_var_val_str(pdu, oid_arr, oid_arr_len,
                                    (varbind_val_f && SvOK(*varbind_val_f) ?
                                     SvPV(*varbind_val_f,na):NULL),
@@ -32,7 +33,7 @@
                                     SvCUR(*varbind_val_f):0),
                                    type);
  
-@@ -4563,7 +4563,7 @@
+@@ -4563,7 +4563,7 @@ snmp_inform(sess_ref,uptime,trap_oid,var
                      res = __add_var_val_str(pdu, oid_arr, oid_arr_len,
                                    (varbind_val_f && SvOK(*varbind_val_f) ?
                                     SvPV(*varbind_val_f,na):NULL),

net-snmp-5.4.1-perl-snprintf.patch:

Index: net-snmp-5.4.1-perl-snprintf.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4.1-perl-snprintf.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4.1-perl-snprintf.patch	10 Jun 2008 06:02:57 -0000	1.1
+++ net-snmp-5.4.1-perl-snprintf.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -3,9 +3,10 @@
 Source: upstream, http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=rev&sortby=date&revision=16770
 Reviewed-By: Jan Safranek <jsafrane at redhat.com>
 
---- branches/V5-4-patches/net-snmp/perl/SNMP/SNMP.xs	2007/12/21 23:19:29	16769
-+++ branches/V5-4-patches/net-snmp/perl/SNMP/SNMP.xs	2007/12/22 19:22:44	16770
-@@ -470,14 +470,16 @@
+diff -up net-snmp-5.4.1/perl/SNMP/SNMP.xs.backup_patch_18 net-snmp-5.4.1/perl/SNMP/SNMP.xs
+--- net-snmp-5.4.1/perl/SNMP/SNMP.xs.backup_patch_18	2007-06-19 00:28:09.000000000 +0200
++++ net-snmp-5.4.1/perl/SNMP/SNMP.xs	2008-07-25 12:54:02.000000000 +0200
+@@ -470,14 +470,16 @@ int flag;
             if (flag == USE_ENUMS) {
                for(ep = tp->enums; ep; ep = ep->next) {
                   if (ep->value == *var->val.integer) {
@@ -24,7 +25,7 @@
                len = strlen(buf);
             }
             break;
-@@ -486,21 +488,25 @@
+@@ -486,21 +488,25 @@ int flag;
          case ASN_COUNTER:
          case ASN_TIMETICKS:
          case ASN_UINTEGER:
@@ -56,7 +57,7 @@
  
          case ASN_NULL:
             break;
-@@ -512,14 +518,14 @@
+@@ -512,14 +518,14 @@ int flag;
            break;
  
  	case SNMP_ENDOFMIBVIEW:
@@ -77,7 +78,7 @@
  
          case ASN_COUNTER64:
  #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
-@@ -538,19 +544,19 @@
+@@ -538,19 +544,19 @@ int flag;
  #endif
  
          case ASN_BIT_STR:

net-snmp-5.4.1-pie.patch:

Index: net-snmp-5.4.1-pie.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4.1-pie.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4.1-pie.patch	7 Aug 2007 12:33:35 -0000	1.1
+++ net-snmp-5.4.1-pie.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,16 +1,6 @@
---- net-snmp-5.4.1/apps/Makefile.in.orig	2007-07-05 01:26:56.000000000 +0200
-+++ net-snmp-5.4.1/apps/Makefile.in	2007-08-07 11:05:41.000000000 +0200
-@@ -115,7 +115,7 @@ snmptest$(EXEEXT):    snmptest.$(OSUFFIX
- 	$(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS} 
- 
- snmptrapd$(EXEEXT):    $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)
--	$(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) $(LOCAL_LIBS) ${LDFLAGS} ${TRAPLIBS}
-+	$(LINK) ${CFLAGS} -o $@ -pie $(TRAPD_OBJECTS) $(INSTALLLIBS) $(LOCAL_LIBS) ${LDFLAGS} ${TRAPLIBS}
- 
- snmptrap$(EXEEXT):    snmptrap.$(OSUFFIX) $(USELIBS)
- 	$(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS} 
---- net-snmp-5.4.1/agent/Makefile.in.orig	2007-07-05 01:26:56.000000000 +0200
-+++ net-snmp-5.4.1/agent/Makefile.in	2007-08-07 11:05:19.000000000 +0200
+diff -up net-snmp-5.4.1/agent/Makefile.in.backup_patch_4 net-snmp-5.4.1/agent/Makefile.in
+--- net-snmp-5.4.1/agent/Makefile.in.backup_patch_4	2007-07-05 01:26:56.000000000 +0200
++++ net-snmp-5.4.1/agent/Makefile.in	2008-07-25 12:52:44.000000000 +0200
 @@ -139,7 +139,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c
  	$(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $? 
  
@@ -20,3 +10,15 @@
  
  
  libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION):    ${LLIBAGENTOBJS} $(USELIBS)
+diff -up net-snmp-5.4.1/apps/Makefile.in.backup_patch_4 net-snmp-5.4.1/apps/Makefile.in
+--- net-snmp-5.4.1/apps/Makefile.in.backup_patch_4	2007-07-05 01:26:56.000000000 +0200
++++ net-snmp-5.4.1/apps/Makefile.in	2008-07-25 12:52:44.000000000 +0200
+@@ -115,7 +115,7 @@ snmptest$(EXEEXT):    snmptest.$(OSUFFIX
+ 	$(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS} 
+ 
+ snmptrapd$(EXEEXT):    $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)
+-	$(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) $(LOCAL_LIBS) ${LDFLAGS} ${TRAPLIBS}
++	$(LINK) ${CFLAGS} -o $@ -pie $(TRAPD_OBJECTS) $(INSTALLLIBS) $(LOCAL_LIBS) ${LDFLAGS} ${TRAPLIBS}
+ 
+ snmptrap$(EXEEXT):    snmptrap.$(OSUFFIX) $(USELIBS)
+ 	$(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS} 

net-snmp-5.4.1-sensors3.patch:

Index: net-snmp-5.4.1-sensors3.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4.1-sensors3.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4.1-sensors3.patch	14 Nov 2007 14:30:41 -0000	1.1
+++ net-snmp-5.4.1-sensors3.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -4,355 +4,287 @@
 
 Index: configure
 ===================================================================
---- configure	(revision 16736)
-+++ configure	(revision 16739)
-@@ -32628,7 +32628,7 @@
- fi
- 
- # LM-SENSORS-MIB support
--echo " $module_list " | grep " ucd-snmp/lmSensors " > /dev/null
-+echo " $module_list " | $GREP -i "ucd-snmp/lmsensor" > /dev/null
- if test $? -eq 0 ; then
-         { echo "$as_me:$LINENO: checking for sensors support" >&5
- echo $ECHO_N "checking for sensors support... $ECHO_C" >&6; }
-Index: include/net-snmp/agent/hardware/sensors.h
-===================================================================
---- include/net-snmp/agent/hardware/sensors.h	(revision 0)
-+++ include/net-snmp/agent/hardware/sensors.h	(revision 16739)
-@@ -0,0 +1,48 @@
-+/*
-+ * Hardware Abstraction Layer - Sensors module
-+ *
-+ * Public interface
-+ */
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/dummy_sensors.c
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/dummy_sensors.c	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1,60 @@
++#include <net-snmp/net-snmp-config.h>
++#include <net-snmp/net-snmp-includes.h>
++#include <net-snmp/agent/net-snmp-agent-includes.h>
++#include <net-snmp/agent/hardware/sensors.h>
 +
-+#define NETSNMP_SENSOR_TYPE_OTHER       1
-+#define NETSNMP_SENSOR_TYPE_VOLTAGE_AC  3
-+#define NETSNMP_SENSOR_TYPE_VOLTAGE_DC  4
-+#define NETSNMP_SENSOR_TYPE_CURRENT     5
-+#define NETSNMP_SENSOR_TYPE_POWER       6
-+#define NETSNMP_SENSOR_TYPE_FREQUENCY   7
-+#define NETSNMP_SENSOR_TYPE_TEMPERATURE 8
-+#define NETSNMP_SENSOR_TYPE_HUMIDITY    9
-+#define NETSNMP_SENSOR_TYPE_RPM        10
-+#define NETSNMP_SENSOR_TYPE_VOLUME     11
-+#define NETSNMP_SENSOR_TYPE_BOOLEAN    12
 +
++void netsnmp_sensor_arch_init( void ) {
++    /* Nothing to do */
++    DEBUGMSGTL(("sensors:arch", "Initialise Dummy Sensors module\n"));
++}
 +
-+#define NETSNMP_SENSOR_FLAG_ACTIVE     0x01
-+#define NETSNMP_SENSOR_FLAG_NAVAIL     0x02
-+#define NETSNMP_SENSOR_FLAG_BROKEN     0x04
-+#define NETSNMP_SENSOR_FLAG_DISABLE    0x08
++int
++netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) {
++    time_t now;
++    struct tm                  *tm;
++    netsnmp_sensor_info        *sp;
 +
-+#define NETSNMP_SENSOR_MASK_STATUS     0x06  /* NAVAIL|BROKEN */
++    time(&now);
++    tm = localtime(&now);
 +
++    DEBUGMSGTL(("sensors:arch", "Reload Dummy Sensors module\n"));
 +
-+#define NETSNMP_SENSOR_FIND_CREATE     1   /* or use one of the sensor type values */
-+#define NETSNMP_SENSOR_FIND_EXIST      0
++    /* First pseudo-sensor - slowly-rising temperature */
++    sp = sensor_by_name( "minute", NETSNMP_SENSOR_TYPE_TEMPERATURE );
++    sp->value = tm->tm_min;
++    snprintf( sp->descr, 256, "Minute-based pseudo-sensor - slowly-rising temperature" );
++    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
 +
-+typedef struct netsnmp_sensor_info_s netsnmp_sensor_info;
-+struct netsnmp_sensor_info_s {
++    /* Second pseudo-sensor - quickly-rising temperature */
++    sp = sensor_by_name( "second", NETSNMP_SENSOR_TYPE_TEMPERATURE );
++    sp->value = tm->tm_sec;
++    snprintf( sp->descr, 256, "Second-based pseudo-sensor - quickly-rising temperature" );
++    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
 +
-+    netsnmp_index  idx;
-+    /* int  idx; */
-+    char  name[256];
-+    
-+    int   type;
-+    float value;
-+    char  descr[256];
-+    long  flags;
-+};
++    /* Third pseudo-sensor - annual fan speed */
++    sp = sensor_by_name( "year", NETSNMP_SENSOR_TYPE_RPM );
++    sp->value = tm->tm_year + 1900;
++    snprintf( sp->descr, 256, "RPM pseudo-sensor - annual fan speed" );
++    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
 +
-+netsnmp_container   *get_sensor_container( void );
-+netsnmp_cache       *get_sensor_cache( void );
-+netsnmp_sensor_info *sensor_by_name( char *, int );
-+NetsnmpCacheLoad     netsnmp_sensor_load;
-+NetsnmpCacheFree     netsnmp_sensor_free;
-Index: configure.in
-===================================================================
---- configure.in	(revision 16736)
-+++ configure.in	(revision 16739)
-@@ -2885,7 +2885,7 @@
- fi
- 
- # LM-SENSORS-MIB support
--echo " $module_list " | grep " ucd-snmp/lmSensors " > /dev/null
-+echo " $module_list " | $GREP -i "ucd-snmp/lmsensor" > /dev/null
- if test $? -eq 0 ; then
-         AC_MSG_CHECKING([for sensors support])
-         case $target_os in
-Index: agent/mibgroup/ucd-snmp/lmsensorsMib.c
-===================================================================
---- agent/mibgroup/ucd-snmp/lmsensorsMib.c	(revision 0)
-+++ agent/mibgroup/ucd-snmp/lmsensorsMib.c	(revision 16739)
-@@ -0,0 +1,205 @@
++    /* Fourth pseudo-sensor - daily voltage */
++    sp = sensor_by_name( "day", NETSNMP_SENSOR_TYPE_VOLTAGE_DC );
++    sp->value = tm->tm_mday-20;
++    snprintf( sp->descr, 256, "Day-based pseudo-sensor - positive or negative voltage" );
++    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++
++    /* Fifth pseudo-sensor - monthly voltage */
++    sp = sensor_by_name( "month", NETSNMP_SENSOR_TYPE_VOLTAGE_DC );
++    sp->value = tm->tm_mon;
++    snprintf( sp->descr, 256, "Month-based pseudo-sensor - positive voltage" );
++    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++
++    /* Sixth pseudo-sensor - annual daily something */
++    sp = sensor_by_name( "yday", NETSNMP_SENSOR_TYPE_OTHER );
++    sp->value = tm->tm_yday;
++    snprintf( sp->descr, 256, "Day-based pseudo-sensor - annual something" );
++    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++
++    return 0;
++}
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/dummy_sensors.h
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/dummy_sensors.h	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1 @@
++config_require(hardware/sensors/hw_sensors)
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors.h
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors.h	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1,13 @@
++config_require(hardware/sensors/hw_sensors)
++
++#if defined(solaris)
++# if defined(HAVE_PICL_H)
++config_require(hardware/sensors/picld_sensors)
++# else
++config_require(hardware/sensors/kstat_sensors)
++# endif
++#else
++config_require(hardware/sensors/lmsensors_v3)
++#endif
++
++//config_require(hardware/sensors/dummy_sensors)
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/hw_sensors.c
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/hw_sensors.c	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1,183 @@
 +#include <net-snmp/net-snmp-config.h>
 +#include <net-snmp/net-snmp-includes.h>
 +#include <net-snmp/agent/net-snmp-agent-includes.h>
 +#include <net-snmp/agent/hardware/sensors.h>
-+#include "ucd-snmp/lmsensorsMib.h"
-+
-+netsnmp_container *sensorContainer = NULL;
 +
-+void initialize_lmSensorsTable(const char *tableName, oid *tableOID,
-+                               netsnmp_container_op *filter, int mult );
 +
-+int _sensor_filter_temp( netsnmp_container *c, const void *v );
-+int _sensor_filter_fan(  netsnmp_container *c, const void *v );
-+int _sensor_filter_volt( netsnmp_container *c, const void *v );
-+int _sensor_filter_misc( netsnmp_container *c, const void *v );
++extern NetsnmpCacheLoad netsnmp_sensor_arch_load;
++extern void             netsnmp_sensor_arch_init( void );
++static int  _sensor_load( void );
++static void _sensor_free( void );
 +
-+static oid lmTempSensorsTable_oid[]   = {1,3,6,1,4,1,2021,13,16,2};
-+static oid lmFanSensorsTable_oid[]    = {1,3,6,1,4,1,2021,13,16,3};
-+static oid lmVoltSensorsTable_oid[]   = {1,3,6,1,4,1,2021,13,16,4};
-+static oid lmMiscSensorsTable_oid[]   = {1,3,6,1,4,1,2021,13,16,5};
-+            /* All the tables have the same length root OID */
-+size_t     lmSensorsTables_oid_len = OID_LENGTH(lmMiscSensorsTable_oid);
++static int _sensorAutoUpdate = 0;   /* 0 means on-demand caching */
++static void _sensor_update_stats( unsigned int, void* );
 +
++netsnmp_cache     *_sensor_cache     = NULL;
++netsnmp_container *_sensor_container = NULL;
++static int         _sensor_idx       = 0;
 +
-+/* Initialise the LM Sensors MIB module */
-+void
-+init_lmsensorsMib(void)
-+{
-+    DEBUGMSGTL(("ucd-snmp/lmsensorsMib","Initializing LM-SENSORS-MIB tables\n"));
++void init_hw_sensors( void ) {
 +
-+    /* 
-+     * Initialise the four LM-SENSORS-MIB tables
-+     *
-+     * They are almost identical, so we can use the same registration code.
-+     */
-+    initialize_lmSensorsTable( "lmTempSensorsTable", lmTempSensorsTable_oid,
-+                                _sensor_filter_temp, 1000 );  /* MIB asks for mC */
-+    initialize_lmSensorsTable( "lmFanSensorsTable",  lmFanSensorsTable_oid,
-+                                _sensor_filter_fan,  1);
-+    initialize_lmSensorsTable( "lmVoltSensorsTable", lmVoltSensorsTable_oid,
-+                                _sensor_filter_volt, 1000 );  /* MIB asks for mV */
-+    initialize_lmSensorsTable( "lmMiscSensorsTable", lmMiscSensorsTable_oid,
-+                                _sensor_filter_misc, 1 );
-+}
++    if ( _sensor_container )
++        return;   /* Already initialised */
 +
-+/*
-+ * Common initialisation code, used for setting up all four tables
-+ */
-+void
-+initialize_lmSensorsTable(const char *tableName, oid *tableOID,
-+                          netsnmp_container_op *filter, int mult )
-+{
-+    netsnmp_handler_registration    *reg;
-+    netsnmp_table_registration_info *table_info;
-+    netsnmp_cache     *cache;
-+    netsnmp_container *container;
++    DEBUGMSGTL(("sensors", "Initialise Hardware Sensors module\n"));
 +
 +    /*
-+     * Ensure the HAL sensors module has been initialised,
-+     *   and retrieve the main sensors container.
-+     * This table will then be registered using a filter on this container.
++     * Define a container to hold the basic list of sensors
++     * The four LM-SENSOR-MIB containers will be created in
++     *  the relevant initialisation routine(s)
 +     */
-+    sensorContainer = get_sensor_container();
-+    if ( !sensorContainer ) {
-+        init_hw_sensors( );
-+        sensorContainer = get_sensor_container();
++    _sensor_container = netsnmp_container_find("sensorTable:table_container");
++    if ( NULL == _sensor_container ) {
++        snmp_log( LOG_ERR, "failed to create container for sensorTable");
++        return;
 +    }
-+    container = netsnmp_container_find("sensorTable:table_container");
-+    container->insert_filter = filter;
-+    netsnmp_container_add_index( sensorContainer, container );
-+
-+
-+    /*
-+     * Create a basic registration structure for the table
-+     */
-+    reg = netsnmp_create_handler_registration(
-+               tableName, lmSensorsTables_handler,
-+               tableOID,  lmSensorsTables_oid_len, HANDLER_CAN_RONLY
-+              );
-+
-+    /*
-+     * Register the table using the filtered container
-+     * Include an indicator of any scaling to be applied to the sensor value
-+     */
-+    reg->my_reg_void = (void *)mult;
-+    table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
-+    netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, 0);
-+    table_info->min_column = COLUMN_LMSENSORS_INDEX;
-+    table_info->max_column = COLUMN_LMSENSORS_VALUE;
-+    netsnmp_container_table_register( reg, table_info, container, 0 );
++    netsnmp_sensor_arch_init( );
 +
 +    /*
-+     * If the HAL sensors module was configured as an on-demand caching
-+     *  module (rather than being automatically loaded regularly),
-+     *  then ensure this table makes use of that cache.
++     * If we're sampling the sensor information automatically,
++     *   then arrange for this to be triggered regularly.
++     *
++     * If we're not sampling these values regularly,
++     *   create a suitable cache handler instead.
 +     */
-+    cache = get_sensor_cache();
-+    if ( cache ) {
-+        netsnmp_inject_handler_before( reg, netsnmp_cache_handler_get( cache ),
-+                                            "table_container");
++    if ( _sensorAutoUpdate ) {
++        DEBUGMSGTL(("sensors", "Reloading Hardware Sensors automatically (%d)\n",
++                               _sensorAutoUpdate));
++        snmp_alarm_register( _sensorAutoUpdate, SA_REPEAT,
++                             _sensor_update_stats, NULL );
++    }
++    else {
++        _sensor_cache = netsnmp_cache_create( 5, netsnmp_sensor_load,
++                                                 netsnmp_sensor_free, NULL, 0 );
++        DEBUGMSGTL(("sensors", "Reloading Hardware Sensors on-demand (%p)\n",
++                               _sensor_cache));
 +    }
++}
 +
++void shutdown_hw_sensors( void ) {
++    _sensor_free();
 +}
 +
++/*
++ *  Return the main sensor container
++ */
++netsnmp_container *get_sensor_container( void ) { return _sensor_container; }
 +
 +/*
-+ *  Container filters for the four tables
-+ *
-+ *  Used to ensure that sensor entries appear in the appropriate table.
++ *  Return the main sensor cache control structure (if defined)
 + */
-+int _sensor_filter_temp( netsnmp_container *c, const void *v ) {
-+    const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
-+    /* Only matches temperature sensors */
-+    return (( sp->type == NETSNMP_SENSOR_TYPE_TEMPERATURE ) ? 0 : 1 );
-+}
++netsnmp_cache *get_sensor_cache( void ) { return _sensor_cache; }
 +
-+int _sensor_filter_fan( netsnmp_container *c, const void *v ) {
-+    const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
-+    /* Only matches fan sensors */
-+    return (( sp->type == NETSNMP_SENSOR_TYPE_RPM ) ? 0 : 1 );
++
++/*
++ * Wrapper routine for automatically updating sensor statistics
++ */
++void
++_sensor_update_stats( unsigned int clientreg, void *data )
++{
++    _sensor_free();
++    _sensor_load();
 +}
 +
-+int _sensor_filter_volt( netsnmp_container *c, const void *v ) {
-+    const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
-+    /* Only matches voltage sensors (AC or DC) */
-+    return ((( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_DC ) ||
-+             ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_AC )) ? 0 : 1 );
++/*
++ * Wrapper routine for re-loading sensor statistics on demand
++ */
++int
++netsnmp_sensor_load( netsnmp_cache *cache, void *data )
++{
++    return _sensor_load();
 +}
 +
-+int _sensor_filter_misc( netsnmp_container *c, const void *v ) {
-+    const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
-+    /* Matches everything except temperature, fan or voltage sensors */
-+    return ((( sp->type == NETSNMP_SENSOR_TYPE_TEMPERATURE ) ||
-+             ( sp->type == NETSNMP_SENSOR_TYPE_RPM         ) ||
-+             ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_DC  ) ||
-+             ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_AC  )) ? 1 : 0 );
++/*
++ * Wrapper routine for releasing expired sensor statistics
++ */
++void
++netsnmp_sensor_free( netsnmp_cache *cache, void *data )
++{
++    _sensor_free();
 +}
 +
 +
 +/*
-+ * Handle requests for any of the four lmXxxxSensorsTables 
-+ *
-+ * This is possible because all the table share the
-+ *  same structure and behaviour.
++ * Architecture-independent processing of loading sensor statistics
 + */
-+int
-+lmSensorsTables_handler(
-+    netsnmp_mib_handler               *handler,
-+    netsnmp_handler_registration      *reginfo,
-+    netsnmp_agent_request_info        *reqinfo,
-+    netsnmp_request_info              *requests) {
++static int
++_sensor_load( void )
++{
++    netsnmp_sensor_arch_load( NULL, NULL );
++}
 +
-+    netsnmp_request_info       *request;
-+    netsnmp_table_request_info *table_info;
-+    netsnmp_sensor_info        *sensor_info;
-+    int mult  = (int)reginfo->my_reg_void;
++/*
++ * Architecture-independent release of sensor statistics
++ */
++static void
++_sensor_free( void )
++{
++    netsnmp_sensor_info *sp;
 +
-+    DEBUGMSGTL(( "ucd-snmp/lmsensorsMib","lmSensorsTables_handler - root: "));
-+    DEBUGMSGOID(("ucd-snmp/lmsensorsMib", reginfo->rootoid, reginfo->rootoid_len));
-+    DEBUGMSG((   "ucd-snmp/lmsensorsMib",", mode %d\n", reqinfo->mode ));
-+    /*
-+     * This is a read-only table, so we only need to handle GET requests.
-+     *    (The container helper converts GETNEXT->GET requests automatically).
-+     */
-+    switch (reqinfo->mode) {
-+    case MODE_GET:
-+        for (request=requests; request; request=request->next) {
-+            sensor_info = (netsnmp_sensor_info *)
-+                            netsnmp_container_table_extract_context(request);
-+            if ( !sensor_info ) {
-+                netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
-+                continue;
-+            }
-+    
-+            table_info   =  netsnmp_extract_table_info(request);
-+            switch (table_info->colnum) {
-+            case COLUMN_LMSENSORS_INDEX:
-+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
-+                                            sensor_info->idx.oids[0]);
-+                break;
-+            case COLUMN_LMSENSORS_DEVICE:
-+                if ( sensor_info->descr[0] != '\0' ) {
-+                    snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR,
-+                                              sensor_info->descr, strlen(sensor_info->descr));
-+                } else {
-+                    snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR,
-+                                              sensor_info->name,  strlen(sensor_info->name));
-+                }
-+                break;
-+            case COLUMN_LMSENSORS_VALUE:
-+                /* Multiply the value by the appropriate scaling factor for this table */
-+                snmp_set_var_typed_integer( request->requestvb, ASN_GAUGE,
-+                                            (int)(mult*sensor_info->value));
-+                break;
-+            default:
-+                netsnmp_set_request_error(reqinfo, request,
-+                                          SNMP_NOSUCHOBJECT);
-+                break;
-+            }
-+        }
-+        break;
++    for (sp = CONTAINER_FIRST( _sensor_container );
++         sp;
++         sp = CONTAINER_NEXT(  _sensor_container, sp )) {
 +
++         sp->flags &= ~ NETSNMP_SENSOR_FLAG_ACTIVE;
 +    }
-+    return SNMP_ERR_NOERROR;
 +}
-Index: agent/mibgroup/ucd-snmp/lmsensorsMib.h
-===================================================================
---- agent/mibgroup/ucd-snmp/lmsensorsMib.h	(revision 0)
-+++ agent/mibgroup/ucd-snmp/lmsensorsMib.h	(revision 16739)
-@@ -0,0 +1,23 @@
-+#ifndef LM_SENSORS_MIB_H
-+#define LM_SENSORS_MIB_H
-+
-+config_require(hardware/sensors)
-+config_add_mib(LM-SENSORS-MIB)
 +
-+/* function declarations */
-+void init_lmsensorsMib(void);
 +
 +/*
-+ * Handler and Column definitions for lmXxxxSensorsTable
-+ *
-+ * Note that the same handler (and hence the same
-+ *  column identifiers) are used for all four tables.
-+ * This is possible because all the table share the
-+ *  same structure and behaviour.
++ * Retrieve a sensor entry by name,
++ *  or (optionally) insert a new one into the container
 + */
-+Netsnmp_Node_Handler lmSensorsTables_handler;
-+#define COLUMN_LMSENSORS_INDEX		1
-+#define COLUMN_LMSENSORS_DEVICE		2
-+#define COLUMN_LMSENSORS_VALUE		3
++netsnmp_sensor_info *
++sensor_by_name( char *name, int create_type )
++{
++    netsnmp_sensor_info *sp;
 +
-+#endif /* LM_SENSORS_MIB_H */
-Index: agent/mibgroup/hardware/sensors.h
-===================================================================
---- agent/mibgroup/hardware/sensors.h	(revision 0)
-+++ agent/mibgroup/hardware/sensors.h	(revision 16739)
-@@ -0,0 +1,13 @@
-+config_require(hardware/sensors/hw_sensors)
++    DEBUGMSGTL(("sensors:name", "Get sensor entry (%s)\n", name));
 +
-+#if defined(solaris)
-+# if defined(HAVE_PICL_H)
-+config_require(hardware/sensors/picld_sensors)
-+# else
-+config_require(hardware/sensors/kstat_sensors)
-+# endif
-+#else
-+config_require(hardware/sensors/lmsensors_v3)
-+#endif
++    /*
++     *  Look through the list for a matching entry
++     */
++        /* .. or use a secondary index container ?? */
++    for (sp = CONTAINER_FIRST( _sensor_container );
++         sp;
++         sp = CONTAINER_NEXT(  _sensor_container, sp )) {
 +
-+//config_require(hardware/sensors/dummy_sensors)
-Index: agent/mibgroup/hardware/sensors/hw_sensors.h
-===================================================================
---- agent/mibgroup/hardware/sensors/hw_sensors.h	(revision 0)
-+++ agent/mibgroup/hardware/sensors/hw_sensors.h	(revision 16739)
++        if ( !strcmp( name, sp->name ))
++            return sp;
++    }
++
++    /*
++     * Not found...
++     */
++    if ( create_type == NETSNMP_SENSOR_FIND_EXIST ) {
++        DEBUGMSGTL(("sensors:name", "No such sensor entry\n"));
++        return NULL;
++    }
++
++    /*
++     * ... so let's create a new one, using the type supplied
++     */
++    sp = SNMP_MALLOC_TYPEDEF( netsnmp_sensor_info );
++    if ( sp ) {
++        strcpy( sp->name, name );
++        sp->type = create_type;
++        /*
++         * Set up the index value.
++         *  
++         * All this trouble, just for a simple integer.
++         * Surely there must be a better way?
++         */
++        sp->idx.len  = 1;
++        sp->idx.oids = SNMP_MALLOC_TYPEDEF( oid );
++        sp->idx.oids[0] = ++_sensor_idx;
++    }
++
++    DEBUGMSGTL(("sensors:name", "Create sensor entry (type = %d, index = %d\n",
++                                 create_type, _sensor_idx));
++    CONTAINER_INSERT( _sensor_container, sp );
++    return sp;
++}
++
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/hw_sensors.h
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/hw_sensors.h	2008-07-25 12:53:46.000000000 +0200
 @@ -0,0 +1 @@
 +void init_hw_sensors( void );
-Index: agent/mibgroup/hardware/sensors/lmsensors_v2.h
-===================================================================
---- agent/mibgroup/hardware/sensors/lmsensors_v2.h	(revision 0)
-+++ agent/mibgroup/hardware/sensors/lmsensors_v2.h	(revision 16739)
-@@ -0,0 +1 @@
-+config_require(hardware/sensors/hw_sensors)
-Index: agent/mibgroup/hardware/sensors/kstat_sensors.c
-===================================================================
---- agent/mibgroup/hardware/sensors/kstat_sensors.c	(revision 0)
-+++ agent/mibgroup/hardware/sensors/kstat_sensors.c	(revision 16739)
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/kstat_sensors.c
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/kstat_sensors.c	2008-07-25 12:53:46.000000000 +0200
 @@ -0,0 +1,161 @@
 +#include <net-snmp/net-snmp-config.h>
 +#include <net-snmp/net-snmp-includes.h>
@@ -515,87 +447,208 @@
 +
 +    return 0;
 +}
-Index: agent/mibgroup/hardware/sensors/lmsensors_v3.h
-===================================================================
---- agent/mibgroup/hardware/sensors/lmsensors_v3.h	(revision 0)
-+++ agent/mibgroup/hardware/sensors/lmsensors_v3.h	(revision 16739)
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/kstat_sensors.h
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/kstat_sensors.h	2008-07-25 12:53:46.000000000 +0200
 @@ -0,0 +1 @@
 +config_require(hardware/sensors/hw_sensors)
-Index: agent/mibgroup/hardware/sensors/dummy_sensors.c
-===================================================================
---- agent/mibgroup/hardware/sensors/dummy_sensors.c	(revision 0)
-+++ agent/mibgroup/hardware/sensors/dummy_sensors.c	(revision 16739)
-@@ -0,0 +1,60 @@
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v2.c
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v2.c	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1,75 @@
 +#include <net-snmp/net-snmp-config.h>
 +#include <net-snmp/net-snmp-includes.h>
 +#include <net-snmp/agent/net-snmp-agent-includes.h>
 +#include <net-snmp/agent/hardware/sensors.h>
 +
++#include "util_funcs.h"
++#include <time.h>
++#include <sensors/sensors.h>
 +
 +void netsnmp_sensor_arch_init( void ) {
-+    /* Nothing to do */
-+    DEBUGMSGTL(("sensors:arch", "Initialise Dummy Sensors module\n"));
++    FILE *fp = fopen("/etc/sensors.conf", "r");
++    DEBUGMSGTL(("sensors:arch", "Initialise LM Sensors module\n"));
++    sensors_init( fp );
 +}
 +
 +int
 +netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) {
-+    time_t now;
-+    struct tm                  *tm;
 +    netsnmp_sensor_info        *sp;
++    const sensors_chip_name    *chip;
++    const sensors_feature_data *data;
++    int             chip_nr = 0;
 +
-+    time(&now);
-+    tm = localtime(&now);
-+
-+    DEBUGMSGTL(("sensors:arch", "Reload Dummy Sensors module\n"));
-+
-+    /* First pseudo-sensor - slowly-rising temperature */
-+    sp = sensor_by_name( "minute", NETSNMP_SENSOR_TYPE_TEMPERATURE );
-+    sp->value = tm->tm_min;
-+    snprintf( sp->descr, 256, "Minute-based pseudo-sensor - slowly-rising temperature" );
-+    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
-+
-+    /* Second pseudo-sensor - quickly-rising temperature */
-+    sp = sensor_by_name( "second", NETSNMP_SENSOR_TYPE_TEMPERATURE );
-+    sp->value = tm->tm_sec;
-+    snprintf( sp->descr, 256, "Second-based pseudo-sensor - quickly-rising temperature" );
-+    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++    DEBUGMSGTL(("sensors:arch", "Reload LM Sensors module\n"));
++    while ((chip = sensors_get_detected_chips(&chip_nr))) {
++	int             a = 0;
++	int             b = 0;
 +
-+    /* Third pseudo-sensor - annual fan speed */
-+    sp = sensor_by_name( "year", NETSNMP_SENSOR_TYPE_RPM );
-+    sp->value = tm->tm_year + 1900;
-+    snprintf( sp->descr, 256, "RPM pseudo-sensor - annual fan speed" );
-+    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++        while ((data = sensors_get_all_features(*chip, &a, &b))) {
++            DEBUGMSGTL(("sensors:arch:detail", "get_all_features (%d, %d)\n", a, b));
++            char           *label = NULL;
++            double          val;
++            int             type = NETSNMP_SENSOR_TYPE_OTHER;
 +
-+    /* Fourth pseudo-sensor - daily voltage */
-+    sp = sensor_by_name( "day", NETSNMP_SENSOR_TYPE_VOLTAGE_DC );
-+    sp->value = tm->tm_mday-20;
-+    snprintf( sp->descr, 256, "Day-based pseudo-sensor - positive or negative voltage" );
-+    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++            if ((data->mode & SENSORS_MODE_R) &&
++                (data->mapping == SENSORS_NO_MAPPING) &&
++                !sensors_get_label(*chip, data->number, &label) &&
++                !sensors_get_feature(*chip, data->number, &val)) {
 +
-+    /* Fifth pseudo-sensor - monthly voltage */
-+    sp = sensor_by_name( "month", NETSNMP_SENSOR_TYPE_VOLTAGE_DC );
-+    sp->value = tm->tm_mon;
-+    snprintf( sp->descr, 256, "Month-based pseudo-sensor - positive voltage" );
-+    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++                DEBUGMSGTL(("sensors:arch:detail", "%s = %f\n", label, val));
++                /*
++                 * Determine the type of sensor from the description.
++                 *
++                 * If the text being looked for below is not in the label of a
++                 * given sensor (e.g., the temp1 sensor has been labeled 'CPU'
++                 * rather than 'CPU temp') it will be categorised as OTHER.
++                 */
++                if (strstr(label, "V")) {
++                    type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC;
++                }
++                if (strstr(label, "fan") || strstr(label, "Fan")) {
++                    type = NETSNMP_SENSOR_TYPE_RPM;
++                }
++                if (strstr(label, "temp") || strstr(label, "Temp")) {
++                    type = NETSNMP_SENSOR_TYPE_TEMPERATURE;
++                }
 +
-+    /* Sixth pseudo-sensor - annual daily something */
-+    sp = sensor_by_name( "yday", NETSNMP_SENSOR_TYPE_OTHER );
-+    sp->value = tm->tm_yday;
-+    snprintf( sp->descr, 256, "Day-based pseudo-sensor - annual something" );
-+    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++                /*
++                 * Use this type to create a new sensor entry
++                 *  (inserting it in the appropriate sub-containers)
++                 */
++                sp = sensor_by_name( label, type );
++                if ( sp ) {
++                    sp->value = val;
++                    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++                }
++            }
++	    if (label) {
++		free(label);
++		label = NULL;
++	    }
++        } /* end while data */
++    } /* end while chip */
++
++    return 0;
++}
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v2.h
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v2.h	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1 @@
++config_require(hardware/sensors/hw_sensors)
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v3.c
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v3.c	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1,101 @@
++#include <net-snmp/net-snmp-config.h>
++#include <net-snmp/net-snmp-includes.h>
++#include <net-snmp/agent/net-snmp-agent-includes.h>
++#include <net-snmp/agent/hardware/sensors.h>
++
++#include "util_funcs.h"
++#include <time.h>
++#include <sensors/sensors.h>
++
++
++void netsnmp_sensor_arch_init( void ) {
++    FILE *fp = fopen("/etc/sensors.conf", "r");
++    DEBUGMSGTL(("sensors:arch", "Initialise v3 LM Sensors module\n"));
++    sensors_init( fp );
++}
++
++int
++netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) {
++    netsnmp_sensor_info        *sp;
++    const sensors_chip_name    *chip;
++    const sensors_feature      *data;
++    const sensors_subfeature   *data2;
++    int             chip_nr = 0;
++
++    DEBUGMSGTL(("sensors:arch", "Reload v3 LM Sensors module\n"));
++    while ((chip = sensors_get_detected_chips( NULL, &chip_nr))) {
++	int             a = 0;
++
++        while ((data = sensors_get_features( chip, &a))) {
++            DEBUGMSGTL(("sensors:arch:detail", "get_features (%s, %d)\n", data->name, data->number));
++	    int             b = 0;
++ 
++
++            while ((data2 = sensors_get_all_subfeatures( chip, data, &b))) {
++                char           *label = NULL;
++                double          val;
++                int             type = NETSNMP_SENSOR_TYPE_OTHER;
++
++                DEBUGMSGTL(("sensors:arch:detail", "  get_subfeatures (%s, %d)\n", data2->name, data2->number));
++                /*
++                 * Check the type of this subfeature,
++                 *   concentrating on the main "input" measurements.
++                 */
++                switch ( data2->type ) {
++                case SENSORS_SUBFEATURE_IN_INPUT:
++                    type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC;
++                    break;
++                case SENSORS_SUBFEATURE_FAN_INPUT:
++                    type = NETSNMP_SENSOR_TYPE_RPM;
++                    break;
++                case SENSORS_SUBFEATURE_TEMP_INPUT:
++                    type = NETSNMP_SENSOR_TYPE_TEMPERATURE;
++                    break;
++                case SENSORS_SUBFEATURE_VID:
++                    type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC;
++                    break;
++                default:
++                    /* Skip everything other than these basic sensor features - ??? */
++                    DEBUGMSGTL(("sensors:arch:detail", "  Skip type %x\n", data2->type));
++                    continue;
++                }
++            
++                /*
++                 * Get the name and value of this subfeature
++                 */
++/*
++                if (!(label = sensors_get_label(chip, data))) {
++                    DEBUGMSGTL(("sensors:arch:detail", "  Can't get name (%s)\n", label));
++                    continue;
++                }
++                if (sensors_get_value(chip, data2->number, &val) < 0) {
++                    DEBUGMSGTL(("sensors:arch:detail", "  Can't get value (%f)\n", val));
++                    continue;
++                }
++*/
++                if (!(label = sensors_get_label(chip, data)) ||
++                     (sensors_get_value(chip, data2->number, &val) < 0)) {
++                    DEBUGMSGTL(("sensors:arch:detail", "  Can't get name/value (%s, %f)\n", label, val));
++                    continue;
++                }
++                DEBUGMSGTL(("sensors:arch:detail", "%s = %f\n", label, val));
++
++                /*
++                 * Use this type to create a new sensor entry
++                 *  (inserting it in the appropriate sub-containers)
++                 */
++                sp = sensor_by_name( label, type );
++                if ( sp ) {
++                    sp->value = val;
++                    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++                }
++	        if (label) {
++		    free(label);
++		    label = NULL;
++	        }
++            } /* end while data2 */
++        } /* end while data */
++    } /* end while chip */
 +
 +    return 0;
 +}
-Index: agent/mibgroup/hardware/sensors/kstat_sensors.h
-===================================================================
---- agent/mibgroup/hardware/sensors/kstat_sensors.h	(revision 0)
-+++ agent/mibgroup/hardware/sensors/kstat_sensors.h	(revision 16739)
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v3.h
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v3.h	2008-07-25 12:53:46.000000000 +0200
 @@ -0,0 +1 @@
 +config_require(hardware/sensors/hw_sensors)
-Index: agent/mibgroup/hardware/sensors/picld_sensors.c
-===================================================================
---- agent/mibgroup/hardware/sensors/picld_sensors.c	(revision 0)
-+++ agent/mibgroup/hardware/sensors/picld_sensors.c	(revision 16739)
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/picld_sensors.c
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/picld_sensors.c	2008-07-25 12:53:46.000000000 +0200
 @@ -0,0 +1,341 @@
 +#include <net-snmp/net-snmp-config.h>
 +#include <net-snmp/net-snmp-includes.h>
@@ -938,389 +991,320 @@
 +    picl_shutdown();
 +}
 +
-Index: agent/mibgroup/hardware/sensors/hw_sensors.c
-===================================================================
---- agent/mibgroup/hardware/sensors/hw_sensors.c	(revision 0)
-+++ agent/mibgroup/hardware/sensors/hw_sensors.c	(revision 16739)
-@@ -0,0 +1,183 @@
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/picld_sensors.h
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/picld_sensors.h	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1 @@
++config_require(hardware/sensors/hw_sensors)
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/ucd-snmp/lmsensorsMib.c
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/lmsensorsMib.c	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1,205 @@
 +#include <net-snmp/net-snmp-config.h>
 +#include <net-snmp/net-snmp-includes.h>
 +#include <net-snmp/agent/net-snmp-agent-includes.h>
 +#include <net-snmp/agent/hardware/sensors.h>
++#include "ucd-snmp/lmsensorsMib.h"
 +
++netsnmp_container *sensorContainer = NULL;
 +
-+extern NetsnmpCacheLoad netsnmp_sensor_arch_load;
-+extern void             netsnmp_sensor_arch_init( void );
-+static int  _sensor_load( void );
-+static void _sensor_free( void );
-+
-+static int _sensorAutoUpdate = 0;   /* 0 means on-demand caching */
-+static void _sensor_update_stats( unsigned int, void* );
-+
-+netsnmp_cache     *_sensor_cache     = NULL;
-+netsnmp_container *_sensor_container = NULL;
-+static int         _sensor_idx       = 0;
++void initialize_lmSensorsTable(const char *tableName, oid *tableOID,
++                               netsnmp_container_op *filter, int mult );
 +
-+void init_hw_sensors( void ) {
++int _sensor_filter_temp( netsnmp_container *c, const void *v );
++int _sensor_filter_fan(  netsnmp_container *c, const void *v );
++int _sensor_filter_volt( netsnmp_container *c, const void *v );
++int _sensor_filter_misc( netsnmp_container *c, const void *v );
 +
-+    if ( _sensor_container )
-+        return;   /* Already initialised */
++static oid lmTempSensorsTable_oid[]   = {1,3,6,1,4,1,2021,13,16,2};
++static oid lmFanSensorsTable_oid[]    = {1,3,6,1,4,1,2021,13,16,3};
++static oid lmVoltSensorsTable_oid[]   = {1,3,6,1,4,1,2021,13,16,4};
++static oid lmMiscSensorsTable_oid[]   = {1,3,6,1,4,1,2021,13,16,5};
++            /* All the tables have the same length root OID */
++size_t     lmSensorsTables_oid_len = OID_LENGTH(lmMiscSensorsTable_oid);
 +
-+    DEBUGMSGTL(("sensors", "Initialise Hardware Sensors module\n"));
 +
-+    /*
-+     * Define a container to hold the basic list of sensors
-+     * The four LM-SENSOR-MIB containers will be created in
-+     *  the relevant initialisation routine(s)
-+     */
-+    _sensor_container = netsnmp_container_find("sensorTable:table_container");
-+    if ( NULL == _sensor_container ) {
-+        snmp_log( LOG_ERR, "failed to create container for sensorTable");
-+        return;
-+    }
-+    netsnmp_sensor_arch_init( );
++/* Initialise the LM Sensors MIB module */
++void
++init_lmsensorsMib(void)
++{
++    DEBUGMSGTL(("ucd-snmp/lmsensorsMib","Initializing LM-SENSORS-MIB tables\n"));
 +
-+    /*
-+     * If we're sampling the sensor information automatically,
-+     *   then arrange for this to be triggered regularly.
++    /* 
++     * Initialise the four LM-SENSORS-MIB tables
 +     *
-+     * If we're not sampling these values regularly,
-+     *   create a suitable cache handler instead.
++     * They are almost identical, so we can use the same registration code.
 +     */
-+    if ( _sensorAutoUpdate ) {
-+        DEBUGMSGTL(("sensors", "Reloading Hardware Sensors automatically (%d)\n",
-+                               _sensorAutoUpdate));
-+        snmp_alarm_register( _sensorAutoUpdate, SA_REPEAT,
-+                             _sensor_update_stats, NULL );
-+    }
-+    else {
-+        _sensor_cache = netsnmp_cache_create( 5, netsnmp_sensor_load,
-+                                                 netsnmp_sensor_free, NULL, 0 );
-+        DEBUGMSGTL(("sensors", "Reloading Hardware Sensors on-demand (%p)\n",
-+                               _sensor_cache));
-+    }
-+}
-+
-+void shutdown_hw_sensors( void ) {
-+    _sensor_free();
++    initialize_lmSensorsTable( "lmTempSensorsTable", lmTempSensorsTable_oid,
++                                _sensor_filter_temp, 1000 );  /* MIB asks for mC */
++    initialize_lmSensorsTable( "lmFanSensorsTable",  lmFanSensorsTable_oid,
++                                _sensor_filter_fan,  1);
++    initialize_lmSensorsTable( "lmVoltSensorsTable", lmVoltSensorsTable_oid,
++                                _sensor_filter_volt, 1000 );  /* MIB asks for mV */
++    initialize_lmSensorsTable( "lmMiscSensorsTable", lmMiscSensorsTable_oid,
++                                _sensor_filter_misc, 1 );
 +}
 +
 +/*
-+ *  Return the main sensor container
-+ */
-+netsnmp_container *get_sensor_container( void ) { return _sensor_container; }
-+
-+/*
-+ *  Return the main sensor cache control structure (if defined)
-+ */
-+netsnmp_cache *get_sensor_cache( void ) { return _sensor_cache; }
-+
-+
-+/*
-+ * Wrapper routine for automatically updating sensor statistics
++ * Common initialisation code, used for setting up all four tables
 + */
 +void
-+_sensor_update_stats( unsigned int clientreg, void *data )
++initialize_lmSensorsTable(const char *tableName, oid *tableOID,
++                          netsnmp_container_op *filter, int mult )
 +{
-+    _sensor_free();
-+    _sensor_load();
-+}
++    netsnmp_handler_registration    *reg;
++    netsnmp_table_registration_info *table_info;
++    netsnmp_cache     *cache;
++    netsnmp_container *container;
 +
-+/*
-+ * Wrapper routine for re-loading sensor statistics on demand
-+ */
-+int
-+netsnmp_sensor_load( netsnmp_cache *cache, void *data )
-+{
-+    return _sensor_load();
-+}
-+
-+/*
-+ * Wrapper routine for releasing expired sensor statistics
-+ */
-+void
-+netsnmp_sensor_free( netsnmp_cache *cache, void *data )
-+{
-+    _sensor_free();
-+}
-+
-+
-+/*
-+ * Architecture-independent processing of loading sensor statistics
-+ */
-+static int
-+_sensor_load( void )
-+{
-+    netsnmp_sensor_arch_load( NULL, NULL );
-+}
-+
-+/*
-+ * Architecture-independent release of sensor statistics
-+ */
-+static void
-+_sensor_free( void )
-+{
-+    netsnmp_sensor_info *sp;
-+
-+    for (sp = CONTAINER_FIRST( _sensor_container );
-+         sp;
-+         sp = CONTAINER_NEXT(  _sensor_container, sp )) {
-+
-+         sp->flags &= ~ NETSNMP_SENSOR_FLAG_ACTIVE;
++    /*
++     * Ensure the HAL sensors module has been initialised,
++     *   and retrieve the main sensors container.
++     * This table will then be registered using a filter on this container.
++     */
++    sensorContainer = get_sensor_container();
++    if ( !sensorContainer ) {
++        init_hw_sensors( );
++        sensorContainer = get_sensor_container();
 +    }
-+}
-+
-+
-+/*
-+ * Retrieve a sensor entry by name,
-+ *  or (optionally) insert a new one into the container
-+ */
-+netsnmp_sensor_info *
-+sensor_by_name( char *name, int create_type )
-+{
-+    netsnmp_sensor_info *sp;
++    container = netsnmp_container_find("sensorTable:table_container");
++    container->insert_filter = filter;
++    netsnmp_container_add_index( sensorContainer, container );
 +
-+    DEBUGMSGTL(("sensors:name", "Get sensor entry (%s)\n", name));
 +
 +    /*
-+     *  Look through the list for a matching entry
++     * Create a basic registration structure for the table
 +     */
-+        /* .. or use a secondary index container ?? */
-+    for (sp = CONTAINER_FIRST( _sensor_container );
-+         sp;
-+         sp = CONTAINER_NEXT(  _sensor_container, sp )) {
-+
-+        if ( !strcmp( name, sp->name ))
-+            return sp;
-+    }
++    reg = netsnmp_create_handler_registration(
++               tableName, lmSensorsTables_handler,
++               tableOID,  lmSensorsTables_oid_len, HANDLER_CAN_RONLY
++              );
 +
 +    /*
-+     * Not found...
++     * Register the table using the filtered container
++     * Include an indicator of any scaling to be applied to the sensor value
 +     */
-+    if ( create_type == NETSNMP_SENSOR_FIND_EXIST ) {
-+        DEBUGMSGTL(("sensors:name", "No such sensor entry\n"));
-+        return NULL;
-+    }
++    reg->my_reg_void = (void *)mult;
++    table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
++    netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, 0);
++    table_info->min_column = COLUMN_LMSENSORS_INDEX;
++    table_info->max_column = COLUMN_LMSENSORS_VALUE;
++    netsnmp_container_table_register( reg, table_info, container, 0 );
 +
 +    /*
-+     * ... so let's create a new one, using the type supplied
++     * If the HAL sensors module was configured as an on-demand caching
++     *  module (rather than being automatically loaded regularly),
++     *  then ensure this table makes use of that cache.
 +     */
-+    sp = SNMP_MALLOC_TYPEDEF( netsnmp_sensor_info );
-+    if ( sp ) {
-+        strcpy( sp->name, name );
-+        sp->type = create_type;
-+        /*
-+         * Set up the index value.
-+         *  
-+         * All this trouble, just for a simple integer.
-+         * Surely there must be a better way?
-+         */
-+        sp->idx.len  = 1;
-+        sp->idx.oids = SNMP_MALLOC_TYPEDEF( oid );
-+        sp->idx.oids[0] = ++_sensor_idx;
++    cache = get_sensor_cache();
++    if ( cache ) {
++        netsnmp_inject_handler_before( reg, netsnmp_cache_handler_get( cache ),
++                                            "table_container");
 +    }
 +
-+    DEBUGMSGTL(("sensors:name", "Create sensor entry (type = %d, index = %d\n",
-+                                 create_type, _sensor_idx));
-+    CONTAINER_INSERT( _sensor_container, sp );
-+    return sp;
 +}
 +
-Index: agent/mibgroup/hardware/sensors/dummy_sensors.h
-===================================================================
---- agent/mibgroup/hardware/sensors/dummy_sensors.h	(revision 0)
-+++ agent/mibgroup/hardware/sensors/dummy_sensors.h	(revision 16739)
-@@ -0,0 +1 @@
-+config_require(hardware/sensors/hw_sensors)
-Index: agent/mibgroup/hardware/sensors/lmsensors_v2.c
-===================================================================
---- agent/mibgroup/hardware/sensors/lmsensors_v2.c	(revision 0)
-+++ agent/mibgroup/hardware/sensors/lmsensors_v2.c	(revision 16739)
-@@ -0,0 +1,75 @@
-+#include <net-snmp/net-snmp-config.h>
-+#include <net-snmp/net-snmp-includes.h>
-+#include <net-snmp/agent/net-snmp-agent-includes.h>
-+#include <net-snmp/agent/hardware/sensors.h>
 +
-+#include "util_funcs.h"
-+#include <time.h>
-+#include <sensors/sensors.h>
++/*
++ *  Container filters for the four tables
++ *
++ *  Used to ensure that sensor entries appear in the appropriate table.
++ */
++int _sensor_filter_temp( netsnmp_container *c, const void *v ) {
++    const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
++    /* Only matches temperature sensors */
++    return (( sp->type == NETSNMP_SENSOR_TYPE_TEMPERATURE ) ? 0 : 1 );
++}
 +
-+void netsnmp_sensor_arch_init( void ) {
-+    FILE *fp = fopen("/etc/sensors.conf", "r");
-+    DEBUGMSGTL(("sensors:arch", "Initialise LM Sensors module\n"));
-+    sensors_init( fp );
++int _sensor_filter_fan( netsnmp_container *c, const void *v ) {
++    const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
++    /* Only matches fan sensors */
++    return (( sp->type == NETSNMP_SENSOR_TYPE_RPM ) ? 0 : 1 );
 +}
 +
-+int
-+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) {
-+    netsnmp_sensor_info        *sp;
-+    const sensors_chip_name    *chip;
-+    const sensors_feature_data *data;
-+    int             chip_nr = 0;
++int _sensor_filter_volt( netsnmp_container *c, const void *v ) {
++    const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
++    /* Only matches voltage sensors (AC or DC) */
++    return ((( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_DC ) ||
++             ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_AC )) ? 0 : 1 );
++}
 +
-+    DEBUGMSGTL(("sensors:arch", "Reload LM Sensors module\n"));
-+    while ((chip = sensors_get_detected_chips(&chip_nr))) {
-+	int             a = 0;
-+	int             b = 0;
++int _sensor_filter_misc( netsnmp_container *c, const void *v ) {
++    const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v;
++    /* Matches everything except temperature, fan or voltage sensors */
++    return ((( sp->type == NETSNMP_SENSOR_TYPE_TEMPERATURE ) ||
++             ( sp->type == NETSNMP_SENSOR_TYPE_RPM         ) ||
++             ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_DC  ) ||
++             ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_AC  )) ? 1 : 0 );
++}
 +
-+        while ((data = sensors_get_all_features(*chip, &a, &b))) {
-+            DEBUGMSGTL(("sensors:arch:detail", "get_all_features (%d, %d)\n", a, b));
-+            char           *label = NULL;
-+            double          val;
-+            int             type = NETSNMP_SENSOR_TYPE_OTHER;
 +
-+            if ((data->mode & SENSORS_MODE_R) &&
-+                (data->mapping == SENSORS_NO_MAPPING) &&
-+                !sensors_get_label(*chip, data->number, &label) &&
-+                !sensors_get_feature(*chip, data->number, &val)) {
++/*
++ * Handle requests for any of the four lmXxxxSensorsTables 
++ *
++ * This is possible because all the table share the
++ *  same structure and behaviour.
++ */
++int
++lmSensorsTables_handler(
++    netsnmp_mib_handler               *handler,
++    netsnmp_handler_registration      *reginfo,
++    netsnmp_agent_request_info        *reqinfo,
++    netsnmp_request_info              *requests) {
 +
-+                DEBUGMSGTL(("sensors:arch:detail", "%s = %f\n", label, val));
-+                /*
-+                 * Determine the type of sensor from the description.
-+                 *
-+                 * If the text being looked for below is not in the label of a
-+                 * given sensor (e.g., the temp1 sensor has been labeled 'CPU'
-+                 * rather than 'CPU temp') it will be categorised as OTHER.
-+                 */
-+                if (strstr(label, "V")) {
-+                    type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC;
-+                }
-+                if (strstr(label, "fan") || strstr(label, "Fan")) {
-+                    type = NETSNMP_SENSOR_TYPE_RPM;
-+                }
-+                if (strstr(label, "temp") || strstr(label, "Temp")) {
-+                    type = NETSNMP_SENSOR_TYPE_TEMPERATURE;
-+                }
++    netsnmp_request_info       *request;
++    netsnmp_table_request_info *table_info;
++    netsnmp_sensor_info        *sensor_info;
++    int mult  = (int)reginfo->my_reg_void;
 +
-+                /*
-+                 * Use this type to create a new sensor entry
-+                 *  (inserting it in the appropriate sub-containers)
-+                 */
-+                sp = sensor_by_name( label, type );
-+                if ( sp ) {
-+                    sp->value = val;
-+                    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
++    DEBUGMSGTL(( "ucd-snmp/lmsensorsMib","lmSensorsTables_handler - root: "));
++    DEBUGMSGOID(("ucd-snmp/lmsensorsMib", reginfo->rootoid, reginfo->rootoid_len));
++    DEBUGMSG((   "ucd-snmp/lmsensorsMib",", mode %d\n", reqinfo->mode ));
++    /*
++     * This is a read-only table, so we only need to handle GET requests.
++     *    (The container helper converts GETNEXT->GET requests automatically).
++     */
++    switch (reqinfo->mode) {
++    case MODE_GET:
++        for (request=requests; request; request=request->next) {
++            sensor_info = (netsnmp_sensor_info *)
++                            netsnmp_container_table_extract_context(request);
++            if ( !sensor_info ) {
++                netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
++                continue;
++            }
++    
++            table_info   =  netsnmp_extract_table_info(request);
++            switch (table_info->colnum) {
++            case COLUMN_LMSENSORS_INDEX:
++                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
++                                            sensor_info->idx.oids[0]);
++                break;
++            case COLUMN_LMSENSORS_DEVICE:
++                if ( sensor_info->descr[0] != '\0' ) {
++                    snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR,
++                                              sensor_info->descr, strlen(sensor_info->descr));
++                } else {
++                    snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR,
++                                              sensor_info->name,  strlen(sensor_info->name));
 +                }
++                break;
++            case COLUMN_LMSENSORS_VALUE:
++                /* Multiply the value by the appropriate scaling factor for this table */
++                snmp_set_var_typed_integer( request->requestvb, ASN_GAUGE,
++                                            (int)(mult*sensor_info->value));
++                break;
++            default:
++                netsnmp_set_request_error(reqinfo, request,
++                                          SNMP_NOSUCHOBJECT);
++                break;
 +            }
-+	    if (label) {
-+		free(label);
-+		label = NULL;
-+	    }
-+        } /* end while data */
-+    } /* end while chip */
++        }
++        break;
 +
-+    return 0;
++    }
++    return SNMP_ERR_NOERROR;
 +}
-Index: agent/mibgroup/hardware/sensors/picld_sensors.h
-===================================================================
---- agent/mibgroup/hardware/sensors/picld_sensors.h	(revision 0)
-+++ agent/mibgroup/hardware/sensors/picld_sensors.h	(revision 16739)
-@@ -0,0 +1 @@
-+config_require(hardware/sensors/hw_sensors)
-Index: agent/mibgroup/hardware/sensors/lmsensors_v3.c
-===================================================================
---- agent/mibgroup/hardware/sensors/lmsensors_v3.c	(revision 0)
-+++ agent/mibgroup/hardware/sensors/lmsensors_v3.c	(revision 16739)
-@@ -0,0 +1,101 @@
-+#include <net-snmp/net-snmp-config.h>
-+#include <net-snmp/net-snmp-includes.h>
-+#include <net-snmp/agent/net-snmp-agent-includes.h>
-+#include <net-snmp/agent/hardware/sensors.h>
+diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/ucd-snmp/lmsensorsMib.h
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/lmsensorsMib.h	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1,23 @@
++#ifndef LM_SENSORS_MIB_H
++#define LM_SENSORS_MIB_H
 +
-+#include "util_funcs.h"
-+#include <time.h>
-+#include <sensors/sensors.h>
++config_require(hardware/sensors)
++config_add_mib(LM-SENSORS-MIB)
 +
++/* function declarations */
++void init_lmsensorsMib(void);
 +
-+void netsnmp_sensor_arch_init( void ) {
-+    FILE *fp = fopen("/etc/sensors.conf", "r");
-+    DEBUGMSGTL(("sensors:arch", "Initialise v3 LM Sensors module\n"));
-+    sensors_init( fp );
-+}
++/*
++ * Handler and Column definitions for lmXxxxSensorsTable
++ *
++ * Note that the same handler (and hence the same
++ *  column identifiers) are used for all four tables.
++ * This is possible because all the table share the
++ *  same structure and behaviour.
++ */
++Netsnmp_Node_Handler lmSensorsTables_handler;
++#define COLUMN_LMSENSORS_INDEX		1
++#define COLUMN_LMSENSORS_DEVICE		2
++#define COLUMN_LMSENSORS_VALUE		3
 +
-+int
-+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) {
-+    netsnmp_sensor_info        *sp;
-+    const sensors_chip_name    *chip;
-+    const sensors_feature      *data;
-+    const sensors_subfeature   *data2;
-+    int             chip_nr = 0;
++#endif /* LM_SENSORS_MIB_H */
+diff -up net-snmp-5.4.1/configure.backup_patch_15 net-snmp-5.4.1/configure
+--- net-snmp-5.4.1/configure.backup_patch_15	2008-07-25 12:53:39.000000000 +0200
++++ net-snmp-5.4.1/configure	2008-07-25 12:53:46.000000000 +0200
+@@ -31030,7 +31030,7 @@ fi
+ fi
+ 
+ # LM-SENSORS-MIB support
+-echo " $module_list " | grep " ucd-snmp/lmSensors " > /dev/null
++echo " $module_list " | $GREP -i "ucd-snmp/lmsensor" > /dev/null
+ if test $? -eq 0 ; then
+         echo "$as_me:$LINENO: checking for sensors support" >&5
+ echo $ECHO_N "checking for sensors support... $ECHO_C" >&6
+diff -up net-snmp-5.4.1/configure.in.backup_patch_15 net-snmp-5.4.1/configure.in
+--- net-snmp-5.4.1/configure.in.backup_patch_15	2008-07-25 12:53:39.000000000 +0200
++++ net-snmp-5.4.1/configure.in	2008-07-25 12:53:46.000000000 +0200
+@@ -2880,7 +2880,7 @@ if test $? -eq 0 ; then
+ fi
+ 
+ # LM-SENSORS-MIB support
+-echo " $module_list " | grep " ucd-snmp/lmSensors " > /dev/null
++echo " $module_list " | $GREP -i "ucd-snmp/lmsensor" > /dev/null
+ if test $? -eq 0 ; then
+         AC_MSG_CHECKING([for sensors support])
+         case $target_os in
+diff -up /dev/null net-snmp-5.4.1/include/net-snmp/agent/hardware/sensors.h
+--- /dev/null	2008-07-23 14:59:56.660004489 +0200
++++ net-snmp-5.4.1/include/net-snmp/agent/hardware/sensors.h	2008-07-25 12:53:46.000000000 +0200
+@@ -0,0 +1,48 @@
++/*
++ * Hardware Abstraction Layer - Sensors module
++ *
++ * Public interface
++ */
 +
-+    DEBUGMSGTL(("sensors:arch", "Reload v3 LM Sensors module\n"));
-+    while ((chip = sensors_get_detected_chips( NULL, &chip_nr))) {
-+	int             a = 0;
++#define NETSNMP_SENSOR_TYPE_OTHER       1
++#define NETSNMP_SENSOR_TYPE_VOLTAGE_AC  3
++#define NETSNMP_SENSOR_TYPE_VOLTAGE_DC  4
++#define NETSNMP_SENSOR_TYPE_CURRENT     5
++#define NETSNMP_SENSOR_TYPE_POWER       6
++#define NETSNMP_SENSOR_TYPE_FREQUENCY   7
++#define NETSNMP_SENSOR_TYPE_TEMPERATURE 8
++#define NETSNMP_SENSOR_TYPE_HUMIDITY    9
++#define NETSNMP_SENSOR_TYPE_RPM        10
++#define NETSNMP_SENSOR_TYPE_VOLUME     11
++#define NETSNMP_SENSOR_TYPE_BOOLEAN    12
 +
-+        while ((data = sensors_get_features( chip, &a))) {
-+            DEBUGMSGTL(("sensors:arch:detail", "get_features (%s, %d)\n", data->name, data->number));
-+	    int             b = 0;
-+ 
 +
-+            while ((data2 = sensors_get_all_subfeatures( chip, data, &b))) {
-+                char           *label = NULL;
-+                double          val;
-+                int             type = NETSNMP_SENSOR_TYPE_OTHER;
++#define NETSNMP_SENSOR_FLAG_ACTIVE     0x01
++#define NETSNMP_SENSOR_FLAG_NAVAIL     0x02
++#define NETSNMP_SENSOR_FLAG_BROKEN     0x04
++#define NETSNMP_SENSOR_FLAG_DISABLE    0x08
 +
-+                DEBUGMSGTL(("sensors:arch:detail", "  get_subfeatures (%s, %d)\n", data2->name, data2->number));
-+                /*
-+                 * Check the type of this subfeature,
-+                 *   concentrating on the main "input" measurements.
-+                 */
-+                switch ( data2->type ) {
-+                case SENSORS_SUBFEATURE_IN_INPUT:
-+                    type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC;
-+                    break;
-+                case SENSORS_SUBFEATURE_FAN_INPUT:
-+                    type = NETSNMP_SENSOR_TYPE_RPM;
-+                    break;
-+                case SENSORS_SUBFEATURE_TEMP_INPUT:
-+                    type = NETSNMP_SENSOR_TYPE_TEMPERATURE;
-+                    break;
-+                case SENSORS_SUBFEATURE_VID:
-+                    type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC;
-+                    break;
-+                default:
-+                    /* Skip everything other than these basic sensor features - ??? */
-+                    DEBUGMSGTL(("sensors:arch:detail", "  Skip type %x\n", data2->type));
-+                    continue;
-+                }
-+            
-+                /*
-+                 * Get the name and value of this subfeature
-+                 */
-+/*
-+                if (!(label = sensors_get_label(chip, data))) {
-+                    DEBUGMSGTL(("sensors:arch:detail", "  Can't get name (%s)\n", label));
-+                    continue;
-+                }
-+                if (sensors_get_value(chip, data2->number, &val) < 0) {
-+                    DEBUGMSGTL(("sensors:arch:detail", "  Can't get value (%f)\n", val));
-+                    continue;
-+                }
-+*/
-+                if (!(label = sensors_get_label(chip, data)) ||
-+                     (sensors_get_value(chip, data2->number, &val) < 0)) {
-+                    DEBUGMSGTL(("sensors:arch:detail", "  Can't get name/value (%s, %f)\n", label, val));
-+                    continue;
-+                }
-+                DEBUGMSGTL(("sensors:arch:detail", "%s = %f\n", label, val));
++#define NETSNMP_SENSOR_MASK_STATUS     0x06  /* NAVAIL|BROKEN */
 +
-+                /*
-+                 * Use this type to create a new sensor entry
-+                 *  (inserting it in the appropriate sub-containers)
-+                 */
-+                sp = sensor_by_name( label, type );
-+                if ( sp ) {
-+                    sp->value = val;
-+                    sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE;
-+                }
-+	        if (label) {
-+		    free(label);
-+		    label = NULL;
-+	        }
-+            } /* end while data2 */
-+        } /* end while data */
-+    } /* end while chip */
 +
-+    return 0;
-+}
++#define NETSNMP_SENSOR_FIND_CREATE     1   /* or use one of the sensor type values */
++#define NETSNMP_SENSOR_FIND_EXIST      0
++
++typedef struct netsnmp_sensor_info_s netsnmp_sensor_info;
++struct netsnmp_sensor_info_s {
++
++    netsnmp_index  idx;
++    /* int  idx; */
++    char  name[256];
++    
++    int   type;
++    float value;
++    char  descr[256];
++    long  flags;
++};
++
++netsnmp_container   *get_sensor_container( void );
++netsnmp_cache       *get_sensor_cache( void );
++netsnmp_sensor_info *sensor_by_name( char *, int );
++NetsnmpCacheLoad     netsnmp_sensor_load;
++NetsnmpCacheFree     netsnmp_sensor_free;

net-snmp-5.4.1-shared-ip.patch:

Index: net-snmp-5.4.1-shared-ip.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4.1-shared-ip.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4.1-shared-ip.patch	7 Aug 2007 12:33:35 -0000	1.1
+++ net-snmp-5.4.1-shared-ip.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,13 +1,56 @@
---- net-snmp-5.3.1/include/net-snmp/library/container.h.orig	2005-12-04 19:43:04.000000000 +0100
-+++ net-snmp-5.3.1/include/net-snmp/library/container.h	2007-05-04 10:01:38.000000000 +0200
-@@ -370,8 +370,32 @@
+diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c.backup_patch_13 net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
+--- net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c.backup_patch_13	2007-05-17 23:53:28.000000000 +0200
++++ net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c	2008-07-25 12:53:42.000000000 +0200
+@@ -272,11 +272,15 @@ _netsnmp_ioctl_ipaddress_container_load_
+         /*
+          * add entry to container
+          */
+-        if (CONTAINER_INSERT(container, entry) < 0)
+-        {
+-            DEBUGMSGTL(("access:ipaddress:container","error with ipaddress_entry: insert into container failed.\n"));
++        rc = CONTAINER_TRY_INSERT(container, entry);
++        if (rc < 0) {
++            static int logged = 0;
++            if (!logged) {
++                snmp_log(LOG_NOTICE, "Duplicate IP address detected, some interfaces may not be visible in IP-MIB\n");
++                logged = 1;
++            }
++            rc = 0;
+             netsnmp_access_ipaddress_entry_free(entry);
+-            continue;
+         }
+     }
+ 
+diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c.backup_patch_13 net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
+--- net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c.backup_patch_13	2006-09-15 02:48:50.000000000 +0200
++++ net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c	2008-07-25 12:53:42.000000000 +0200
+@@ -324,7 +324,16 @@ _load_v6(netsnmp_container *container, i
+         /*
+          * add entry to container
+          */
+-        CONTAINER_INSERT(container, entry);
++        rc = CONTAINER_TRY_INSERT(container, entry);
++        if (rc < 0) {
++            static int logged = 0;
++            if (!logged) {
++                snmp_log(LOG_NOTICE, "Duplicate IP address detected, some interfaces may not be visible in IP-MIB\n");
++                logged = 1;
++            }
++            netsnmp_access_ipaddress_entry_free(entry);
++        }
++                                    
+     }
+ 
+     fclose(in);
+diff -up net-snmp-5.4.1/include/net-snmp/library/container.h.backup_patch_13 net-snmp-5.4.1/include/net-snmp/library/container.h
+--- net-snmp-5.4.1/include/net-snmp/library/container.h.backup_patch_13	2005-12-04 19:43:04.000000000 +0100
++++ net-snmp-5.4.1/include/net-snmp/library/container.h	2008-07-25 12:53:42.000000000 +0200
+@@ -370,8 +370,32 @@ extern "C" {
              }
          }
          return rc;
--    }
 +    }    
 +
--    
 +     NETSNMP_STATIC_INLINE
 +    int CONTAINER_TRY_INSERT(netsnmp_container *x, const void *k)
 +    {
@@ -30,14 +73,16 @@
 +            }
 +        }
 +        return CONTAINER_INSERT(start, k);
-+    }
+     }
+-    
 +
      /*------------------------------------------------------------------
       * These functions should EXACTLY match the function version in
       * container.c. If you change one, change them both.
---- net-snmp-5.3.1/snmplib/container.c.orig	2006-04-21 02:24:47.000000000 +0200
-+++ net-snmp-5.3.1/snmplib/container.c	2007-05-04 10:34:23.000000000 +0200
-@@ -286,6 +286,29 @@
+diff -up net-snmp-5.4.1/snmplib/container.c.backup_patch_13 net-snmp-5.4.1/snmplib/container.c
+--- net-snmp-5.4.1/snmplib/container.c.backup_patch_13	2006-08-25 11:41:06.000000000 +0200
++++ net-snmp-5.4.1/snmplib/container.c	2008-07-25 12:53:42.000000000 +0200
+@@ -286,6 +286,29 @@ int CONTAINER_INSERT(netsnmp_container *
      return rc;
  }
  
@@ -67,45 +112,3 @@
  /*------------------------------------------------------------------
   * These functions should EXACTLY match the inline version in
   * container.h. If you change one, change them both.
---- net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c.orig	2007-05-17 23:53:28.000000000 +0200
-+++ net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c	2007-08-07 13:49:49.000000000 +0200
-@@ -272,11 +272,15 @@ _netsnmp_ioctl_ipaddress_container_load_
-         /*
-          * add entry to container
-          */
--        if (CONTAINER_INSERT(container, entry) < 0)
--        {
--            DEBUGMSGTL(("access:ipaddress:container","error with ipaddress_entry: insert into container failed.\n"));
-+        rc = CONTAINER_TRY_INSERT(container, entry);
-+        if (rc < 0) {
-+            static int logged = 0;
-+            if (!logged) {
-+                snmp_log(LOG_NOTICE, "Duplicate IP address detected, some interfaces may not be visible in IP-MIB\n");
-+                logged = 1;
-+            }
-+            rc = 0;
-             netsnmp_access_ipaddress_entry_free(entry);
--            continue;
-         }
-     }
- 
---- net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c.orig	2006-09-15 02:48:50.000000000 +0200
-+++ net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c	2007-08-07 13:47:55.000000000 +0200
-@@ -324,7 +324,16 @@ _load_v6(netsnmp_container *container, i
-         /*
-          * add entry to container
-          */
--        CONTAINER_INSERT(container, entry);
-+        rc = CONTAINER_TRY_INSERT(container, entry);
-+        if (rc < 0) {
-+            static int logged = 0;
-+            if (!logged) {
-+                snmp_log(LOG_NOTICE, "Duplicate IP address detected, some interfaces may not be visible in IP-MIB\n");
-+                logged = 1;
-+            }
-+            netsnmp_access_ipaddress_entry_free(entry);
-+        }
-+                                    
-     }
- 
-     fclose(in);

net-snmp-5.4.1-strange_libpath.patch:

Index: net-snmp-5.4.1-strange_libpath.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4.1-strange_libpath.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4.1-strange_libpath.patch	7 Aug 2007 12:33:35 -0000	1.1
+++ net-snmp-5.4.1-strange_libpath.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,63 +1,6 @@
---- net-snmp-5.4.1/configure.mnttab.orig	2007-07-27 19:04:19.000000000 +0200
-+++ net-snmp-5.4.1/configure.mnttab	2007-08-07 13:32:45.000000000 +0200
-@@ -27930,7 +27930,7 @@ if test "${with_libwrap+set}" = set; the
-   if test "$with_libwrap" != "no"; then
-     if test "$with_libwrap" != "yes"; then
-       CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
--      LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
-+      LDFLAGS="${LDFLAGS} -L$with_libwrap"
-     fi
- 
-     _libs=${LIBS}
-@@ -28134,7 +28134,7 @@ echo "${ECHO_T}yes" >&6
- #define NETSNMP_USE_LIBWRAP 1
- _ACEOF
- 
--	    test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
-+	    test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap"
- 	    _wraplibs="$_wraplibs -lwrap"
- else
-   echo "$as_me: failed program was:" >&5
-@@ -28362,7 +28362,7 @@ echo "${ECHO_T}yes" >&6
- #define NETSNMP_USE_LIBWRAP 1
- _ACEOF
- 
--			test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
-+			test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap"
- 			_wraplibs="$_wraplibs -lwrap -lnsl"
- else
-   echo "$as_me: failed program was:" >&5
---- net-snmp-5.4.1/configure.libdir.orig	2007-08-07 13:31:31.000000000 +0200
-+++ net-snmp-5.4.1/configure.libdir	2007-08-07 13:32:05.000000000 +0200
-@@ -27922,7 +27922,7 @@ if test "${with_libwrap+set}" = set; the
-   if test "$with_libwrap" != "no"; then
-     if test "$with_libwrap" != "yes"; then
-       CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
--      LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
-+      LDFLAGS="${LDFLAGS} -L$with_libwrap"
-     fi
- 
-     _libs=${LIBS}
-@@ -28126,7 +28126,7 @@ echo "${ECHO_T}yes" >&6
- #define NETSNMP_USE_LIBWRAP 1
- _ACEOF
- 
--	    test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
-+	    test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap"
- 	    _wraplibs="$_wraplibs -lwrap"
- else
-   echo "$as_me: failed program was:" >&5
-@@ -28354,7 +28354,7 @@ echo "${ECHO_T}yes" >&6
- #define NETSNMP_USE_LIBWRAP 1
- _ACEOF
- 
--			test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
-+			test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap"
- 			_wraplibs="$_wraplibs -lwrap -lnsl"
- else
-   echo "$as_me: failed program was:" >&5
---- net-snmp-5.4.1/configure.orig	2007-08-07 13:31:31.000000000 +0200
-+++ net-snmp-5.4.1/configure	2007-08-07 13:33:29.000000000 +0200
+diff -up net-snmp-5.4.1/configure.backup_patch_11 net-snmp-5.4.1/configure
+--- net-snmp-5.4.1/configure.backup_patch_11	2008-07-25 12:53:35.000000000 +0200
++++ net-snmp-5.4.1/configure	2008-07-25 12:53:39.000000000 +0200
 @@ -27922,7 +27922,7 @@ if test "${with_libwrap+set}" = set; the
    if test "$with_libwrap" != "no"; then
      if test "$with_libwrap" != "yes"; then
@@ -85,8 +28,9 @@
  			_wraplibs="$_wraplibs -lwrap -lnsl"
  else
    echo "$as_me: failed program was:" >&5
---- net-snmp-5.4.1/configure.in.orig	2007-07-27 19:02:00.000000000 +0200
-+++ net-snmp-5.4.1/configure.in	2007-08-07 13:33:55.000000000 +0200
+diff -up net-snmp-5.4.1/configure.in.backup_patch_11 net-snmp-5.4.1/configure.in
+--- net-snmp-5.4.1/configure.in.backup_patch_11	2007-07-27 19:02:00.000000000 +0200
++++ net-snmp-5.4.1/configure.in	2008-07-25 12:53:39.000000000 +0200
 @@ -2714,7 +2714,7 @@ AC_ARG_WITH(libwrap,
    if test "$with_libwrap" != "no"; then
      if test "$with_libwrap" != "yes"; then
@@ -114,32 +58,3 @@
  			_wraplibs="$_wraplibs -lwrap -lnsl",
  
  			AC_MSG_RESULT(no)
---- net-snmp-5.4.1/configure.libpath.orig	2007-08-07 13:31:31.000000000 +0200
-+++ net-snmp-5.4.1/configure.libpath	2007-08-07 13:34:52.000000000 +0200
-@@ -27922,7 +27922,7 @@ if test "${with_libwrap+set}" = set; the
-   if test "$with_libwrap" != "no"; then
-     if test "$with_libwrap" != "yes"; then
-       CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include"
--      LDFLAGS="${LDFLAGS} -L$with_libwrap/lib"
-+      LDFLAGS="${LDFLAGS} -L$with_libwrap"
-     fi
- 
-     _libs=${LIBS}
-@@ -28126,7 +28126,7 @@ echo "${ECHO_T}yes" >&6
- #define NETSNMP_USE_LIBWRAP 1
- _ACEOF
- 
--	    test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
-+	    test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap"
- 	    _wraplibs="$_wraplibs -lwrap"
- else
-   echo "$as_me: failed program was:" >&5
-@@ -28354,7 +28354,7 @@ echo "${ECHO_T}yes" >&6
- #define NETSNMP_USE_LIBWRAP 1
- _ACEOF
- 
--			test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap/lib"
-+			test "$with_libwrap" != no -a "$with_libwrap" != yes && _wraplibs="-L$with_libwrap"
- 			_wraplibs="$_wraplibs -lwrap -lnsl"
- else
-   echo "$as_me: failed program was:" >&5

net-snmp-5.4.1-xen-crash.patch:

Index: net-snmp-5.4.1-xen-crash.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp-5.4.1-xen-crash.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp-5.4.1-xen-crash.patch	19 Nov 2007 07:50:57 -0000	1.1
+++ net-snmp-5.4.1-xen-crash.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -4,26 +4,40 @@
 
 Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
 ===================================================================
---- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c	(revision 16711)
-+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c	(working copy)
-@@ -258,9 +258,10 @@
-     if ((NULL != rowreq_ctx) &&
-         (MFD_SUCCESS ==
-          ipAddressTable_indexes_set(rowreq_ctx,
-+                                    ipaddress_entry->ia_address_len + 1,
-+                                    ipaddress_entry->ia_address,
-                                     ipaddress_entry->ia_address_len,
--                                    ipaddress_entry->ia_address,
--                                    ipaddress_entry->ia_address_len))) {
-+                                    ipaddress_entry->if_index))) {
-         if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
-             DEBUGMSGTL (("ipAddressTable:access","container insert failed for new entry\n"));
-             ipAddressTable_release_rowreq_ctx(rowreq_ctx);
-Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
-===================================================================
---- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c	(revision 16711)
-+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c	(working copy)
-@@ -348,10 +348,18 @@
+diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_common.c.backup_patch_16 net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
+--- net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_common.c.backup_patch_16	2007-07-17 01:59:44.000000000 +0200
++++ net-snmp-5.4.1/agent/mibgroup/ip-mib/data_access/ipaddress_common.c	2008-07-25 12:53:57.000000000 +0200
+@@ -411,6 +411,7 @@ static int _access_ipaddress_entry_compa
+ {
+     const netsnmp_ipaddress_entry *lh = (const netsnmp_ipaddress_entry *)lhs;
+     const netsnmp_ipaddress_entry *rh = (const netsnmp_ipaddress_entry *)rhs;
++    int   rc;
+ 
+     netsnmp_assert(NULL != lhs);
+     netsnmp_assert(NULL != rhs);
+@@ -426,5 +427,17 @@ static int _access_ipaddress_entry_compa
+     /*
+      * length equal, compare address
+      */
+-    return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
++    rc = memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
++    if (rc)
++        return rc;
++
++    /*
++     * address same, compare ifIndex
++     */
++    if (lh->if_index < rh->if_index)
++        return -1;
++    else if (lh->if_index > rh->if_index)
++        return 1;
++
++    return 0;
+ }
+diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c.backup_patch_16 net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
+--- net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c.backup_patch_16	2006-12-06 16:10:40.000000000 +0100
++++ net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c	2008-07-25 12:53:57.000000000 +0200
+@@ -348,10 +348,18 @@ ipAddressAddrType_map(u_long * mib_ipAdd
          *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4;
          break;
  
@@ -42,7 +56,7 @@
      default:
          snmp_log(LOG_ERR, "couldn't map value %ld for ipAddressAddrType\n",
                   raw_ipAddressAddrType_val);
-@@ -382,8 +390,11 @@
+@@ -382,8 +390,11 @@ int
  ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index * tbl_idx,
                                     u_long ipAddressAddrType_val,
                                     char *ipAddressAddr_val_ptr,
@@ -55,7 +69,7 @@
      DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set_tbl_idx", "called\n"));
  
      /*
-@@ -409,6 +420,11 @@
+@@ -409,6 +420,11 @@ ipAddressTable_indexes_set_tbl_idx(ipAdd
      memcpy(tbl_idx->ipAddressAddr, ipAddressAddr_val_ptr,
             ipAddressAddr_val_ptr_len * sizeof(ipAddressAddr_val_ptr[0]));
  
@@ -67,7 +81,7 @@
  
      return MFD_SUCCESS;
  }                               /* ipAddressTable_indexes_set_tbl_idx */
-@@ -430,7 +446,8 @@
+@@ -430,7 +446,8 @@ int
  ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
                             u_long ipAddressAddrType_val,
                             char *ipAddressAddr_val_ptr,
@@ -77,7 +91,7 @@
  {
      DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set",
                  "called\n"));
-@@ -439,7 +456,8 @@
+@@ -439,7 +456,8 @@ ipAddressTable_indexes_set(ipAddressTabl
          ipAddressTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
                                             ipAddressAddrType_val,
                                             ipAddressAddr_val_ptr,
@@ -87,11 +101,10 @@
          return MFD_ERROR;
  
      /*
-Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
-===================================================================
---- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h	(revision 16711)
-+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h	(working copy)
-@@ -106,7 +106,9 @@
+diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h.backup_patch_16 net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
+--- net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h.backup_patch_16	2005-12-01 18:00:57.000000000 +0100
++++ net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h	2008-07-25 12:53:57.000000000 +0200
+@@ -106,7 +106,9 @@ extern          "C" {
       * simplistic map of address length to type
       */
  #define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4  4
@@ -101,11 +114,26 @@
  
  
  /*************************************************************
-Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
-===================================================================
---- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h	(revision 16711)
-+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h	(working copy)
-@@ -273,14 +273,16 @@
+diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c.backup_patch_16 net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
+--- net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c.backup_patch_16	2007-05-17 23:53:28.000000000 +0200
++++ net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c	2008-07-25 12:53:57.000000000 +0200
+@@ -258,9 +258,10 @@ _add_new_entry(netsnmp_ipaddress_entry *
+     if ((NULL != rowreq_ctx) &&
+         (MFD_SUCCESS ==
+          ipAddressTable_indexes_set(rowreq_ctx,
+-                                    ipaddress_entry->ia_address_len,
++                                    ipaddress_entry->ia_address_len + 1,
+                                     ipaddress_entry->ia_address,
+-                                    ipaddress_entry->ia_address_len))) {
++                                    ipaddress_entry->ia_address_len,
++                                    ipaddress_entry->if_index))) {
+         if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
+             DEBUGMSGTL (("ipAddressTable:access","container insert failed for new entry\n"));
+             ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+diff -up net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h.backup_patch_16 net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+--- net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h.backup_patch_16	2006-01-25 17:28:12.000000000 +0100
++++ net-snmp-5.4.1/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h	2008-07-25 12:53:57.000000000 +0200
+@@ -273,14 +273,16 @@ config_require(ip-mib/ipAddressTable/ipA
                                             u_long ipAddressAddrType_val,
                                             char *ipAddressAddr_val_ptr,
                                             size_t
@@ -124,34 +152,3 @@
  
  
  
-Index: agent/mibgroup/ip-mib/data_access/ipaddress_common.c
-===================================================================
---- agent/mibgroup/ip-mib/data_access/ipaddress_common.c	(revision 16711)
-+++ agent/mibgroup/ip-mib/data_access/ipaddress_common.c	(working copy)
-@@ -411,6 +415,7 @@
- {
-     const netsnmp_ipaddress_entry *lh = (const netsnmp_ipaddress_entry *)lhs;
-     const netsnmp_ipaddress_entry *rh = (const netsnmp_ipaddress_entry *)rhs;
-+    int   rc;
- 
-     netsnmp_assert(NULL != lhs);
-     netsnmp_assert(NULL != rhs);
-@@ -426,5 +431,17 @@
-     /*
-      * length equal, compare address
-      */
--    return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
-+    rc = memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
-+    if (rc)
-+        return rc;
-+
-+    /*
-+     * address same, compare ifIndex
-+     */
-+    if (lh->if_index < rh->if_index)
-+        return -1;
-+    else if (lh->if_index > rh->if_index)
-+        return 1;
-+
-+    return 0;
- }


Index: net-snmp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/net-snmp.spec,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -r1.154 -r1.155
--- net-snmp.spec	22 Jul 2008 07:46:49 -0000	1.154
+++ net-snmp.spec	25 Jul 2008 11:03:32 -0000	1.155
@@ -1,8 +1,5 @@
 %{!?tcp_wrappers:%define tcp_wrappers 1}
 
-# TODO: rediff all patches and remove following line:
-%define _default_patch_fuzz 2
-
 # Arches on which we need to prevent arch conflicts on net-snmp-config.h
 %define multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64 sparc sparcv9 sparc64
 %define major_ver 5.4.1
@@ -35,16 +32,15 @@
 Patch7: net-snmp-5.2.1-file_offset.patch
 Patch8: net-snmp-5.3.1-multilib.patch
 Patch9: net-snmp-5.4.1-config_libdir.patch
-#Patch10: net-snmp-5.4.1-ethtool-config.patch
-Patch11: net-snmp-5.4.1-strange_libpath.patch
-Patch12: net-snmp-5.4.1-hostname.patch
-Patch13: net-snmp-5.4.1-shared-ip.patch
-Patch14: net-snmp-5.4-exec-crash.patch
-Patch15: net-snmp-5.4.1-sensors3.patch
-Patch16: net-snmp-5.4.1-xen-crash.patch
-Patch17: net-snmp-5.4.1-hmac-check.patch
-Patch18: net-snmp-5.4.1-perl-snprintf.patch
-Patch19: net-snmp-5.4.1-perl-set.patch
+Patch10: net-snmp-5.4.1-strange_libpath.patch
+Patch11: net-snmp-5.4.1-hostname.patch
+Patch12: net-snmp-5.4.1-shared-ip.patch
+Patch13: net-snmp-5.4-exec-crash.patch
+Patch14: net-snmp-5.4.1-sensors3.patch
+Patch15: net-snmp-5.4.1-xen-crash.patch
+Patch16: net-snmp-5.4.1-hmac-check.patch
+Patch17: net-snmp-5.4.1-perl-snprintf.patch
+Patch18: net-snmp-5.4.1-perl-set.patch
 
 Requires(pre): chkconfig
 Requires(post): chkconfig
@@ -168,16 +164,15 @@
 %patch7 -p1 -b .file_offset
 %patch8 -p1 -b .multilib
 %patch9 -p1 -b .libdir
-#%patch10 -p1 -b .ethtool
-%patch11 -p1 -b .libpath
-%patch12 -p1 -b .hostname
-%patch13 -p1 -b .shared-ip
-%patch14 -p1 -b .exec
-%patch15 -p0 -b .sensors
-%patch16 -p0 -b .xen-crash
-%patch17 -p1 -b .hmac-check
-%patch18 -p3 -b .perl-snprintf
-%patch19 -p1 -b .perl-set
+%patch10 -p1 -b .libpath
+%patch11 -p1 -b .hostname
+%patch12 -p1 -b .shared-ip
+%patch13 -p1 -b .exec
+%patch14 -p1 -b .sensors
+%patch15 -p1 -b .xen-crash
+%patch16 -p1 -b .hmac-check
+%patch17 -p1 -b .perl-snprintf
+%patch18 -p1 -b .perl-set
 
 # Do this patch with a perl hack...
 perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh

ucd-snmp-4.2.4.pre3-mnttab.patch:

Index: ucd-snmp-4.2.4.pre3-mnttab.patch
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/devel/ucd-snmp-4.2.4.pre3-mnttab.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ucd-snmp-4.2.4.pre3-mnttab.patch	9 Sep 2004 09:07:53 -0000	1.1
+++ ucd-snmp-4.2.4.pre3-mnttab.patch	25 Jul 2008 11:03:32 -0000	1.2
@@ -1,8 +1,9 @@
---- ucd-snmp-4.2.4.pre3/configure.mnttab	Tue Apr  9 13:56:13 2002
-+++ ucd-snmp-4.2.4.pre3/configure	Tue Apr  9 13:58:14 2002
-@@ -7148,15 +7148,7 @@
- if eval "test \"`echo '$''{'ac_cv_ETC_MNTTAB'+set}'`\" = set"; then
-   echo $ac_n "(cached) $ac_c" 1>&6
+diff -up net-snmp-5.4.1/configure.backup_patch_1 net-snmp-5.4.1/configure
+--- net-snmp-5.4.1/configure.backup_patch_1	2007-07-27 19:04:19.000000000 +0200
++++ net-snmp-5.4.1/configure	2008-07-25 12:52:01.000000000 +0200
+@@ -26579,15 +26579,7 @@ echo $ECHO_N "checking for mount table l
+ if test "${ac_cv_ETC_MNTTAB+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
  else
 -  ac_cv_ETC_MNTTAB="unknown"
 -for i in /etc/mnttab /etc/mtab /etc/filesystems
@@ -15,5 +16,5 @@
 -
 +  ac_cv_ETC_MNTTAB="/etc/mtab"
  fi
- 
- echo "$ac_t""$ac_cv_ETC_MNTTAB" 1>&6
+ echo "$as_me:$LINENO: result: $ac_cv_ETC_MNTTAB" >&5
+ echo "${ECHO_T}$ac_cv_ETC_MNTTAB" >&6




More information about the scm-commits mailing list