[-]
[+]
|
Added |
net-snmp.changes
|
|
[-]
[+]
|
Changed |
net-snmp.spec
^
|
|
[-]
[+]
|
Added |
Add-Default-Router-Table-support.patch
^
|
@@ -0,0 +1,3568 @@
+From c1b7328c39698ce792f7b5082de9dc079da8b848 Mon Sep 17 00:00:00 2001
+From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+Date: Mon, 20 Oct 2008 17:22:10 +0900
+Subject: [PATCH] Add Default Router Table support
+
+From net-snmp patch tracker:
+[ 1708243 ] add linux support for ipDefaultRouterTable OID to net-snmp
+http://sourceforge.net/tracker/index.php?func=detail&aid=1708243&group_id=12694&atid=312694
+
+[ 1724602 ] [Linux] ipDefaultRouterTable improvement
+http://sourceforge.net/tracker/index.php?func=detail&aid=1724602&group_id=12694&atid=312694
+
+[ 1728223 ] [Linux] add configure check for netlink socket
+http://sourceforge.net/tracker/index.php?func=detail&aid=1728223&group_id=12694&atid=312694
+
+Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+---
+ agent/mibgroup/ip-mib/data_access/defaultrouter.h | 29 +
+ .../ip-mib/data_access/defaultrouter_common.c | 291 ++++++
+ .../ip-mib/data_access/defaultrouter_linux.c | 322 ++++++
+ .../mibgroup/ip-mib/data_access/ipaddress_linux.c | 10 +-
+ agent/mibgroup/ip-mib/ipDefaultRouterTable.h | 5 +
+ .../ipDefaultRouterTable/ipDefaultRouterTable.c | 213 ++++
+ .../ipDefaultRouterTable/ipDefaultRouterTable.h | 212 ++++
+ .../ipDefaultRouterTable_data_access.c | 420 ++++++++
+ .../ipDefaultRouterTable_data_access.h | 76 ++
+ .../ipDefaultRouterTable_data_get.c | 325 +++++++
+ .../ipDefaultRouterTable_data_get.h | 84 ++
+ .../ipDefaultRouterTable_enums.h | 93 ++
+ .../ipDefaultRouterTable_interface.c | 1018 ++++++++++++++++++++
+ .../ipDefaultRouterTable_interface.h | 99 ++
+ .../ipDefaultRouterTable_oids.h | 39 +
+ agent/mibgroup/mibII/var_route.c | 1 +
+ configure.in | 23 +
+ include/net-snmp/data_access/defaultrouter.h | 114 +++
+ 18 files changed, 3373 insertions(+), 1 deletions(-)
+ create mode 100644 agent/mibgroup/ip-mib/data_access/defaultrouter.h
+ create mode 100644 agent/mibgroup/ip-mib/data_access/defaultrouter_common.c
+ create mode 100644 agent/mibgroup/ip-mib/data_access/defaultrouter_linux.c
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable.h
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.c
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.c
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access.h
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.c
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get.h
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_enums.h
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.c
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface.h
+ create mode 100644 agent/mibgroup/ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_oids.h
+ create mode 100644 include/net-snmp/data_access/defaultrouter.h
+
+diff --git a/agent/mibgroup/ip-mib/data_access/defaultrouter.h b/agent/mibgroup/ip-mib/data_access/defaultrouter.h
+new file mode 100644
+index 0000000..9e7b1ef
+--- /dev/null
++++ b/agent/mibgroup/ip-mib/data_access/defaultrouter.h
+@@ -0,0 +1,29 @@
++/*
++ * defaultrouter data access header
++ *
++ * $Id: $
++ */
++/**---------------------------------------------------------------------*/
++/*
++ * configure required files
++ *
++ * Notes:
++ *
++ * 1) prefer functionality over platform, where possible. If a method
++ * is available for multiple platforms, test that first. That way
++ * when a new platform is ported, it won't need a new test here.
++ *
++ * 2) don't do detail requirements here. If, for example,
++ * HPUX11 had different reuirements than other HPUX, that should
++ * be handled in the *_hpux.h header file.
++ */
++config_require(ip-mib/data_access/defaultrouter_common)
++#if defined( linux )
++config_require(ip-mib/data_access/defaultrouter_linux)
++#else
++/*
++ * couldn't determine the correct file!
++ * require a bogus file to generate an error.
++ */
++config_require(ip-mib/data_access/defaultrouter-unknown-arch);
++#endif
+diff --git a/agent/mibgroup/ip-mib/data_access/defaultrouter_common.c b/agent/mibgroup/ip-mib/data_access/defaultrouter_common.c
+new file mode 100644
+index 0000000..64ca425
+--- /dev/null
++++ b/agent/mibgroup/ip-mib/data_access/defaultrouter_common.c
+@@ -0,0 +1,291 @@
++/*
++ * defaultrouter MIB architecture support
++ *
++ * $Id:$
++ */
++#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/data_access/defaultrouter.h>
++
++#include "ip-mib/ipDefaultRouterTable/ipDefaultRouterTable.h"
++
++/**---------------------------------------------------------------------*/
++/*
++ * local static prototypes
++ */
++static int _access_defaultrouter_entry_compare_addr(const void *lhs,
++ const void *rhs);
++static void _access_defaultrouter_entry_release(netsnmp_defaultrouter_entry * entry,
++ void *unused);
++
++/**---------------------------------------------------------------------*/
++/*
++ * external per-architecture functions prototypes
++ *
++ * These shouldn't be called by the general public, so they aren't in
++ * the header file.
++ */
++extern int
++netsnmp_arch_defaultrouter_entry_init(netsnmp_defaultrouter_entry *entry);
++
++extern int
++netsnmp_arch_defaultrouter_container_load(netsnmp_container* container,
++ u_int load_flags);
++
++/**---------------------------------------------------------------------*/
++/*
++ * container functions
++ */
++/**
++ */
++netsnmp_container *
++netsnmp_access_defaultrouter_container_init(u_int flags)
++{
++ netsnmp_container *container1;
++
++ DEBUGMSGTL(("access:defaultrouter:container", "init\n"));
++
++ /*
++ * create the containers. one indexed by ifIndex, the other
++ * indexed by ifName.
++ */
++ container1 = netsnmp_container_find("access_defaultrouter:table_container");
++ if (NULL == container1) {
++ snmp_log(LOG_ERR, "defaultrouter primary container is not found\n");
++ return NULL;
++ }
++ container1->container_name = strdup("dr_index");
++
++ if (flags & NETSNMP_ACCESS_DEFAULTROUTER_INIT_ADDL_IDX_BY_ADDR) {
++ netsnmp_container *container2 =
++ netsnmp_container_find("defaultrouter_addr:access_defaultrouter:table_container");
++ if (NULL == container2) {
++ snmp_log(LOG_ERR, "defaultrouter secondary container not found\n");
++ CONTAINER_FREE(container1);
++ return NULL;
++ }
++
++ container2->compare = _access_defaultrouter_entry_compare_addr;
++ container2->container_name = strdup("dr_addr");
++
++ netsnmp_container_add_index(container1, container2);
++ }
++
++ return container1;
++}
++
++/**
++ * @retval NULL error
++ * @retval !NULL pointer to container
++ */
++netsnmp_container*
++netsnmp_access_defaultrouter_container_load(netsnmp_container* container,
++ u_int load_flags)
++{
++ int rc;
++ u_int container_flags = 0;
++
++ DEBUGMSGTL(("access:defaultrouter:container", "load\n"));
++
++ if (NULL == container) {
++ if (load_flags & NETSNMP_ACCESS_DEFAULTROUTER_LOAD_ADDL_IDX_BY_ADDR) {
++ container_flags |=
++ NETSNMP_ACCESS_DEFAULTROUTER_INIT_ADDL_IDX_BY_ADDR;
++ }
++ container =
++ netsnmp_access_defaultrouter_container_init(container_flags);
++ }
++
++ if (NULL == container) {
++ snmp_log(LOG_ERR, "no container specified/found for access_defaultrouter\n");
++ return NULL;
++ }
++
++ rc = netsnmp_arch_defaultrouter_container_load(container, load_flags);
|
[-]
[+]
|
Added |
Add-ICMP-Statistics-Tables-support.patch
^
|
@@ -0,0 +1,1477 @@
+From f691d90915f55027107270245494e1d25e340e20 Mon Sep 17 00:00:00 2001
+From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+Date: Mon, 20 Oct 2008 16:43:13 +0900
+Subject: [PATCH] Add ICMP Statistics Tables support
+
+From net-snmp patch tracker:
+[ 1702361 ] Add ability to retrieve /proc/net/snmp6 under linux
+http://sourceforge.net/tracker/index.php?func=detail&aid=1702361&group_id=12694&atid=312694
+
+[ 1702366 ] add support for icmpStatsTable oid under linux
+http://sourceforge.net/tracker/index.php?func=detail&aid=1702366&group_id=12694&atid=312694
+
+[ 1703004 ] consolidate snmp6 caching in mibII read for linux
+http://sourceforge.net/tracker/index.php?func=detail&aid=1703004&group_id=12694&atid=312694
+
+[ 1715395 ] Fix the output form of icmpStatsTable on Linux
+http://sourceforge.net/tracker/index.php?func=detail&aid=1715395&group_id=12694&atid=312694
+
+[ 1721096 ] [Linux] Reply icmpStatsTable with old kernel
+http://sourceforge.net/tracker/index.php?func=detail&aid=1721096&group_id=12694&atid=312694
+
+[ 1823465 ] fix icmp registration and caches
+http://sourceforge.net/tracker/index.php?func=detail&aid=1823465&group_id=12694&atid=312694
+
+[ 1927751 ] Update icmpMsgStatsTable, Take IV
+http://sourceforge.net/tracker/index.php?func=detail&aid=1927751&group_id=12694&atid=312694
+
+Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+---
+ agent/mibgroup/mibII/icmp.c | 578 +++++++++++++++++++++++++++++++++
+ agent/mibgroup/mibII/icmp.h | 15 +
+ agent/mibgroup/mibII/ipv6.c | 2 +-
+ agent/mibgroup/mibII/kernel_linux.c | 483 +++++++++++++++++++++++++---
+ agent/mibgroup/mibII/kernel_linux.h | 86 +++++
+ configure | 5 +-
+ configure.in | 5 +-
+ include/net-snmp/net-snmp-config.h.in | 3 +
+ win32/net-snmp/net-snmp-config.h.in | 3 +
+ 9 files changed, 1138 insertions(+), 42 deletions(-)
+
+diff --git a/agent/mibgroup/mibII/icmp.c b/agent/mibgroup/mibII/icmp.c
+index f3fbb82..50daac1 100644
+--- a/agent/mibgroup/mibII/icmp.c
++++ b/agent/mibgroup/mibII/icmp.c
+@@ -9,6 +9,13 @@
+ #if HAVE_NETINET_IP_ICMP_H
+ #include <netinet/ip_icmp.h>
+ #endif
++
++#ifdef NETSNMP_ENABLE_IPV6
++#if HAVE_NETINET_ICMP6_H
++#include <netinet/icmp6.h>
++#endif
++#endif /* NETSNMP_ENABLE_IPV6 */
++
+ #if HAVE_NETINET_ICMP_VAR_H
+ #include <netinet/icmp_var.h>
+ #endif
+@@ -60,16 +67,388 @@ perfstat_id_t ps_name;
+ * registering underneath
+ */
+ oid icmp_oid[] = { SNMP_OID_MIB2, 5 };
++oid icmp_stats_tbl_oid[] = { SNMP_OID_MIB2, 5, 29 };
++oid icmp_msg_stats_tbl_oid[] = { SNMP_OID_MIB2, 5, 30 };
+ #ifdef USING_MIBII_IP_MODULE
+ extern oid ip_module_oid[];
+ extern int ip_module_oid_len;
+ extern int ip_module_count;
+ #endif
+
++#ifdef linux
++struct icmp_stats_table_entry {
++ __uint32_t ipVer;
++ __uint32_t icmpStatsInMsgs;
++ __uint32_t icmpStatsInErrors;
++ __uint32_t icmpStatsOutMsgs;
++ __uint32_t icmpStatsOutErrors;
++};
++
++struct icmp_stats_table_entry icmp_stats_table[2];
++
++#define ICMP_MSG_STATS_HAS_IN 1
++#define ICMP_MSG_STATS_HAS_OUT 2
++
++struct icmp_msg_stats_table_entry {
++ uint32_t ipVer;
++ uint32_t icmpMsgStatsType;
++ uint32_t icmpMsgStatsInPkts;
++ uint32_t icmpMsgStatsOutPkts;
++ int flags;
++};
++
++#define ICMP_MSG_STATS_IPV4_COUNT 11
++
++#ifdef NETSNMP_ENABLE_IPV6
++#define ICMP_MSG_STATS_IPV6_COUNT 14
++#else
++#define ICMP_MSG_STATS_IPV6_COUNT 0
++#endif /* NETSNMP_ENABLE_IPV6 */
++
++struct icmp_msg_stats_table_entry icmp_msg_stats_table[ICMP_MSG_STATS_IPV4_COUNT + ICMP_MSG_STATS_IPV6_COUNT];
++
++int
++icmp_stats_load(netsnmp_cache *cache, void *vmagic)
++{
++
++ /*
++ * note don't bother using the passed in cache
++ * and vmagic pointers. They are useless as they
++ * currently point to the icmp system stats cache
++ * since I see little point in registering another
++ * cache for this table. Its not really needed
++ */
++
++ int i;
++ struct icmp_mib v4icmp;
++ struct icmp6_mib v6icmp;
++ for(i=0;i<2;i++) {
++ switch(i) {
++ case 0:
++ linux_read_icmp_stat(&v4icmp);
++ icmp_stats_table[i].icmpStatsInMsgs = v4icmp.icmpInMsgs;
++ icmp_stats_table[i].icmpStatsInErrors = v4icmp.icmpInErrors;
++ icmp_stats_table[i].icmpStatsOutMsgs = v4icmp.icmpOutMsgs;
++ icmp_stats_table[i].icmpStatsOutErrors = v4icmp.icmpOutErrors;
++ break;
++ default:
++ memset(&icmp_stats_table[i],0,
++ sizeof(struct icmp_stats_table_entry));
++ linux_read_icmp6_stat(&v6icmp);
++ icmp_stats_table[i].icmpStatsInMsgs = v6icmp.icmp6InMsgs;
++ icmp_stats_table[i].icmpStatsInErrors = v6icmp.icmp6InErrors;
++ icmp_stats_table[i].icmpStatsOutMsgs = v6icmp.icmp6OutMsgs;
++ icmp_stats_table[i].icmpStatsOutErrors = v6icmp.icmp6OutDestUnreachs +
++ v6icmp.icmp6OutPktTooBigs + v6icmp.icmp6OutTimeExcds +
++ v6icmp.icmp6OutParmProblems;
++ break;
++ }
++ icmp_stats_table[i].ipVer=i+1;
++ }
++
++ return 0;
++}
++
++int
++icmp_msg_stats_load(netsnmp_cache *cache, void *vmagic)
++{
++ struct icmp_mib v4icmp;
++ struct icmp4_msg_mib v4icmpmsg;
++ struct icmp6_mib v6icmp;
++ struct icmp6_msg_mib v6icmpmsg;
++ int i, j, k, flag, inc;
++
++ memset(&icmp_msg_stats_table, 0, sizeof(icmp_msg_stats_table));
++
++ i = 0;
++ flag = 0;
++ k = 0;
++ inc = 0;
++ linux_read_icmp_msg_stat(&v4icmp, &v4icmpmsg, &flag);
++ if (flag) {
++ while (254 != k) {
++ if (v4icmpmsg.vals[k].InType) {
++ icmp_msg_stats_table[i].ipVer = 1;
++ icmp_msg_stats_table[i].icmpMsgStatsType = k;
++ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmpmsg.vals[k].InType;
++ icmp_msg_stats_table[i].flags = icmp_msg_stats_table[i].flags | ICMP_MSG_STATS_HAS_IN;
++ inc = 1; /* Set this if we found a valid entry */
++ }
++ if (v4icmpmsg.vals[k].OutType) {
++ icmp_msg_stats_table[i].ipVer = 1;
++ icmp_msg_stats_table[i].icmpMsgStatsType = k;
++ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmpmsg.vals[k].OutType;
++ icmp_msg_stats_table[i].flags = icmp_msg_stats_table[i].flags | ICMP_MSG_STATS_HAS_OUT;
++ inc = 1; /* Set this if we found a valid entry */
++ }
++ if (inc) {
++ i++;
++ inc = 0;
++ }
++ k++;
++ }
++ } else {
++ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_ECHOREPLY;
++ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInEchoReps;
++ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutEchoReps;
++ i++;
++
++ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_DEST_UNREACH;
++ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInDestUnreachs;
++ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutDestUnreachs;
++ i++;
++
++ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_SOURCE_QUENCH;
++ icmp_msg_stats_table[i].icmpMsgStatsInPkts = v4icmp.icmpInSrcQuenchs;
++ icmp_msg_stats_table[i].icmpMsgStatsOutPkts = v4icmp.icmpOutSrcQuenchs;
++ i++;
++
++ icmp_msg_stats_table[i].icmpMsgStatsType = ICMP_REDIRECT;
|
[-]
[+]
|
Added |
Add-IPv6-Scope-Zone-Index.patch
^
|
@@ -0,0 +1,3481 @@
+From 4d63cceb36d6a178aecd4a8e134b6eae795dfdab Mon Sep 17 00:00:00 2001
+From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+Date: Mon, 20 Oct 2008 17:51:43 +0900
+Subject: [PATCH] Add IPv6 Scope Zone Index
+
+[ 1715405 ] Adding ipv6ScopeZoneIndexTable
+http://sourceforge.net/tracker/index.php?func=detail&aid=1715405&group_id=12694&atid=312694
+
+[ 1897883 ] Fix ipv6ScopeZoneIndexTable on Linux
+http://sourceforge.net/tracker/index.php?func=detail&aid=1897883&group_id=12694&atid=312694
+
+Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+---
+ agent/mibgroup/ip-mib/data_access/ipv6scopezone.h | 30 +
+ .../ip-mib/data_access/ipv6scopezone_common.c | 152 +++
+ .../ip-mib/data_access/ipv6scopezone_linux.c | 141 +++
+ agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h | 5 +
+ .../ipv6ScopeZoneIndexTable.c | 1004 +++++++++++++++++
+ .../ipv6ScopeZoneIndexTable.h | 269 +++++
+ .../ipv6ScopeZoneIndexTable_data_access.c | 304 ++++++
+ .../ipv6ScopeZoneIndexTable_data_access.h | 70 ++
+ .../ipv6ScopeZoneIndexTable_enums.h | 39 +
+ .../ipv6ScopeZoneIndexTable_interface.c | 1124 ++++++++++++++++++++
+ .../ipv6ScopeZoneIndexTable_interface.h | 98 ++
+ .../ipv6ScopeZoneIndexTable_oids.h | 55 +
+ include/net-snmp/data_access/scopezone.h | 68 ++
+ 13 files changed, 3359 insertions(+), 0 deletions(-)
+ create mode 100644 agent/mibgroup/ip-mib/data_access/ipv6scopezone.h
+ create mode 100644 agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c
+ create mode 100644 agent/mibgroup/ip-mib/data_access/ipv6scopezone_linux.c
+ create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable.h
+ create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.c
+ create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable.h
+ create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.c
+ create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access.h
+ create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_enums.h
+ create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.c
+ create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface.h
+ create mode 100644 agent/mibgroup/ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_oids.h
+ create mode 100644 include/net-snmp/data_access/scopezone.h
+
+diff --git a/agent/mibgroup/ip-mib/data_access/ipv6scopezone.h b/agent/mibgroup/ip-mib/data_access/ipv6scopezone.h
+new file mode 100644
+index 0000000..8d81b3f
+--- /dev/null
++++ b/agent/mibgroup/ip-mib/data_access/ipv6scopezone.h
+@@ -0,0 +1,30 @@
++/*
++ * scopezone data access header
++ *
++ * $Id: ipv6scopezone.h 14170 2007-04-29 02:22:12Z varun_c $
++ */
++/**---------------------------------------------------------------------*/
++/*
++ * configure required files
++ *
++ * Notes:
++ *
++ * 1) prefer functionality over platform, where possible. If a method
++ * is available for multiple platforms, test that first. That way
++ * when a new platform is ported, it won't need a new test here.
++ *
++ * 2) don't do detail requirements here. If, for example,
++ * HPUX11 had different reuirements than other HPUX, that should
++ * be handled in the *_hpux.h header file.
++ */
++config_require(ip-mib/data_access/ipv6scopezone_common)
++#if defined( linux )
++config_require(ip-mib/data_access/ipv6scopezone_linux)
++#else
++/*
++ * couldn't determine the correct file!
++ * require a bogus file to generate an error.
++ */
++config_require(ip-mib/data_access/ipv6scopezone-unknown-arch);
++#endif
++
+diff --git a/agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c b/agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c
+new file mode 100644
+index 0000000..fdf712b
+--- /dev/null
++++ b/agent/mibgroup/ip-mib/data_access/ipv6scopezone_common.c
+@@ -0,0 +1,152 @@
++/*
++ * ipv6ScopeIndexTable MIB architecture support
++ *
++ * $Id: ipv6scopezone_common.c 14170 2007-04-29 02:22:12Z varun_c $
++ */
++#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/data_access/scopezone.h>
++/*
++ * local static prototypes
++ */
++static void _entry_release(netsnmp_v6scopezone_entry * entry, void *unused);
++
++
++/**---------------------------------------------------------------------*/
++/*
++ * external per-architecture functions prototypes
++ *
++ * These shouldn't be called by the general public, so they aren't in
++ * the header file.
++ */
++extern int
++netsnmp_access_scopezone_container_arch_load(netsnmp_container* container,
++ u_int load_flags);
++extern void
++netsnmp_access_scopezone_arch_init(void);
++
++/**
++ * initialize systemstats container
++ */
++netsnmp_container *
++netsnmp_access_scopezone_container_init(u_int flags)
++{
++ netsnmp_container *container;
++
++ DEBUGMSGTL(("access:scopezone:container", "init\n"));
++ /*
++ * create the containers. one indexed by ifIndex, the other
++ * indexed by ifName.
++ */
++ container = netsnmp_container_find("access_scopezone:table_container");
++ if (NULL == container)
++ return NULL;
++
++ return container;
++}
++
++/**
++ * load scopezone information in specified container
++ *
++ * @param container empty container, or NULL to have one created for you
++ * @param load_flags flags to modify behaviour.
++ *
++ * @retval NULL error
++ * @retval !NULL pointer to container
++ */
++netsnmp_container*
++netsnmp_access_scopezone_container_load(netsnmp_container* container, u_int load_flags)
++{
++ int rc;
++
++ DEBUGMSGTL(("access:scopezone:container", "load\n"));
++
++ if (NULL == container)
++ container = netsnmp_access_scopezone_container_init(load_flags);
++ if (NULL == container) {
++ snmp_log(LOG_ERR, "no container specified/found for access_scopezone\n");
++ return NULL;
++ }
++
++ rc = netsnmp_access_scopezone_container_arch_load(container, load_flags);
++ if (0 != rc) {
++ netsnmp_access_scopezone_container_free(container,
++ NETSNMP_ACCESS_SCOPEZONE_FREE_NOFLAGS);
++ container = NULL;
++ }
++
++ return container;
++}
++
++void
++netsnmp_access_scopezone_container_free(netsnmp_container *container, u_int free_flags)
++{
++ DEBUGMSGTL(("access:scopezone:container", "free\n"));
++
++ if (NULL == container) {
++ snmp_log(LOG_ERR, "invalid container for netsnmp_access_scopezone_free\n");
++ return;
++ }
++
++ if(! (free_flags & NETSNMP_ACCESS_SCOPEZONE_FREE_DONT_CLEAR)) {
++ /*
++ * free all items.
++ */
++ CONTAINER_CLEAR(container,
++ (netsnmp_container_obj_func*)_entry_release,
++ NULL);
++ }
++
++ CONTAINER_FREE(container);
++}
++
++/**
++ */
++netsnmp_v6scopezone_entry *
++netsnmp_access_scopezone_entry_create(void)
++{
++ netsnmp_v6scopezone_entry *entry =
++ SNMP_MALLOC_TYPEDEF(netsnmp_v6scopezone_entry);
++
++ DEBUGMSGTL(("access:scopezone:entry", "create\n"));
++
++ if(NULL == entry)
++ return NULL;
|
[-]
[+]
|
Added |
Add-IPv6-support-on-Internet-Address-Translation-Tab.patch
^
|
@@ -0,0 +1,334 @@
+From ecd91d8a2b532bd1a987369e76d75fef454f2bcf Mon Sep 17 00:00:00 2001
+From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+Date: Mon, 20 Oct 2008 17:33:11 +0900
+Subject: [PATCH] Add IPv6 support on Internet Address Translation Table
+
+[ 1708243 ] add linux support for ipDefaultRouterTable OID to net-snmp
+http://sourceforge.net/tracker/index.php?func=detail&aid=1708243&group_id=12694&atid=312694
+
+[ 1724602 ] [Linux] ipDefaultRouterTable improvement
+http://sourceforge.net/tracker/index.php?func=detail&aid=1724602&group_id=12694&atid=312694
+
+[ 1728223 ] [Linux] add configure check for netlink socket
+http://sourceforge.net/tracker/index.php?func=detail&aid=1728223&group_id=12694&atid=312694
+
+Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+---
+ agent/mibgroup/ip-mib/data_access/arp_linux.c | 243 +++++++++++++++++++-
+ .../inetNetToMediaTable_data_access.c | 2 +-
+ configure.in | 10 +
+ 3 files changed, 249 insertions(+), 6 deletions(-)
+
+diff --git a/agent/mibgroup/ip-mib/data_access/arp_linux.c b/agent/mibgroup/ip-mib/data_access/arp_linux.c
+index e1d20c1..a25e4d8 100644
+--- a/agent/mibgroup/ip-mib/data_access/arp_linux.c
++++ b/agent/mibgroup/ip-mib/data_access/arp_linux.c
+@@ -14,9 +14,32 @@
+ #include <netinet/in.h>
+ #include <net/if_arp.h>
+ #include <arpa/inet.h>
++#include <linux/types.h>
++#include <asm/types.h>
++#ifdef NETSNMP_ENABLE_IPV6
++#ifdef HAVE_LINUX_RTNETLINK_H
++#include <linux/rtnetlink.h>
++#define NIP6(addr) \
++ ntohs((addr).s6_addr16[0]), \
++ ntohs((addr).s6_addr16[1]), \
++ ntohs((addr).s6_addr16[2]), \
++ ntohs((addr).s6_addr16[3]), \
++ ntohs((addr).s6_addr16[4]), \
++ ntohs((addr).s6_addr16[5]), \
++ ntohs((addr).s6_addr16[6]), \
++ ntohs((addr).s6_addr16[7])
++#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
++#endif
++#endif
+
+ int _load_v4(netsnmp_container *container, int idx_offset);
+-
++static int _load_v6(netsnmp_container *container, int idx_offset);
++#ifdef HAVE_LINUX_RTNETLINK_H
++int get_translation_table_info (int sd, int *status,
++ char *buff, size_t size);
++int fillup_entry_info(netsnmp_arp_entry *entry,
++ struct nlmsghdr *nlmp);
++#endif
+ /**
+ */
+ int
+@@ -28,11 +51,10 @@ netsnmp_access_arp_container_arch_load(netsnmp_container *container)
+ if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_ARP_FREE_KEEP_CONTAINER;
+ netsnmp_access_arp_container_free(container, flags);
+- return rc;
+ }
+
+-#if defined (NETSNMP_ENABLE_IPV6) && 0 /* xx-rks: arp for v6? */
+- idx_offset = rc;
++#if defined (NETSNMP_ENABLE_IPV6)
++ idx_offset = (rc < 0) ? 0 : rc;
+
+ rc = _load_v6(container, idx_offset);
+ if(rc < 0) {
+@@ -64,7 +86,7 @@ _load_v4(netsnmp_container *container, int idx_offset)
+
+ #define PROCFILE "/proc/net/arp"
+ if (!(in = fopen(PROCFILE, "r"))) {
+- snmp_log(LOG_ERR,"could not open " PROCFILE "\n");
++ snmp_log(LOG_DEBUG,"could not open " PROCFILE "\n");
+ return -2;
+ }
+
+@@ -192,3 +214,214 @@ _load_v4(netsnmp_container *container, int idx_offset)
+
+ return idx_offset;
+ }
++
++#if defined (NETSNMP_ENABLE_IPV6)
++static int
++_load_v6(netsnmp_container *container, int idx_offset)
++{
++ char buffer[16384];
++#if defined(HAVE_LINUX_RTNETLINK_H)
++ struct nlmsghdr *nlmp;
++#endif
++ int sd = 0;
++ int status = 0;
++ int rc = 0;
++ int len, req_len;
++ netsnmp_arp_entry *entry;
++
++ netsnmp_assert(NULL != container);
++#if defined(HAVE_LINUX_RTNETLINK_H)
++ if((sd = socket (PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE)) < 0) {
++ snmp_log(LOG_ERR,"Unable to create netlink socket\n");
++ return -2;
++ }
++
++ if(get_translation_table_info (sd, &status, buffer, sizeof(buffer)) < 0) {
++ snmp_log(LOG_ERR,"Unable to fetch translation table info\n");
++ close(sd);
++ return -2;
++ }
++
++ for (nlmp = (struct nlmsghdr *)buffer; status > sizeof(*nlmp); ) {
++ len = nlmp->nlmsg_len;
++ req_len = len - sizeof(*nlmp);
++ if (req_len < 0 || len > status) {
++ snmp_log(LOG_ERR,"invalid length\n");
++ return -2;
++ }
++ if (!NLMSG_OK (nlmp, status)) {
++ snmp_log(LOG_ERR,"NLMSG not OK\n");
++ return -2;
++ }
++ entry = netsnmp_access_arp_entry_create();
++ if(NULL == entry) {
++ rc = -3;
++ break;
++ }
++ entry->ns_arp_index = ++idx_offset;
++ if(fillup_entry_info (entry, nlmp) < 0) {
++ DEBUGMSGTL(("access:arp:load_v6", "filling entry info failed\n"));
++ netsnmp_access_arp_entry_free(entry);
++ status -= NLMSG_ALIGN(len);
++ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len));
++ continue;
++ }
++ CONTAINER_INSERT(container, entry);
++ status -= NLMSG_ALIGN(len);
++ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len));
++ }
++
++ close(sd);
++#endif
++ if(rc<0) {
++ return rc;
++ }
++
++ return idx_offset;
++}
++#if defined(HAVE_LINUX_RTNETLINK_H)
++int
++get_translation_table_info (int sd, int *status, char *buff, size_t size)
++{
++ struct {
++ struct nlmsghdr n;
++ struct ndmsg r;
++ char buf[1024];
++ } req;
++ struct rtattr *rta;
++
++ memset(&req, 0, sizeof(req));
++ req.n.nlmsg_len = NLMSG_LENGTH (sizeof(struct ndmsg));
++ req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT;
++ req.n.nlmsg_type = RTM_GETNEIGH;
++
++ req.r.ndm_family = AF_INET6;
++ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.n.nlmsg_len));
++ rta->rta_len = RTA_LENGTH(16);
++
++ if(send(sd, &req, req.n.nlmsg_len, 0) < 0) {
++ snmp_log(LOG_ERR,"Sending request failed\n");
++ return -1;
++ }
++ if((*status = recv(sd, buff, size, 0)) < 0) {
++ snmp_log(LOG_ERR,"Recieving request failed\n");
++ return -1;
++ }
++ if(*status == 0) {
++ snmp_log(LOG_ERR,"End of file\n");
++ return -1;
++ }
++ return 0;
++}
++
++int
++fillup_entry_info(netsnmp_arp_entry *entry, struct nlmsghdr *nlmp)
++{
++ struct ndmsg *rtmp;
++ struct in6_addr *in6p;
++ struct rtattr *tb[NDA_MAX+1], *rta;
++ size_t in_len, out_len;
++ unsigned int i;
++ int length;
++ char addr[40];
++ u_char *buf;
++ u_char *hwaddr;
++
|
[-]
[+]
|
Added |
Fix-for-IPv6-Interface-Table.patch
^
|
@@ -0,0 +1,69 @@
+From 65f75f485f428b0f22ff82c96ebd7d89e49ce7b2 Mon Sep 17 00:00:00 2001
+From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+Date: Mon, 20 Oct 2008 14:50:37 +0900
+Subject: [PATCH] Fix for IPv6 Interface Table
+
+From net-snmp patch tracker:
+[ 1669048 ] Support ipv6InterfaceIdentifier on Linux
+http://sourceforge.net/tracker/index.php?func=detail&aid=1669048&group_id=12694&atid=312694
+
+[ 1783423 ] correct ipv6InterfaceIdentifier of loopback device
+http://sourceforge.net/tracker/index.php?func=detail&aid=1783423&group_id=12694&atid=312694
+
+Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+---
+ .../mibgroup/if-mib/data_access/interface_linux.c | 31 ++++++++++++++++++++
+ 1 files changed, 31 insertions(+), 0 deletions(-)
+
+diff --git a/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c
+index 245fa99..474a904 100644
+--- a/agent/mibgroup/if-mib/data_access/interface_linux.c
++++ b/agent/mibgroup/if-mib/data_access/interface_linux.c
+@@ -36,6 +36,7 @@ typedef __u8 u8; /* ditto */
+ #include <unistd.h>
+
+ #include <linux/sockios.h>
++#include <linux/if_ether.h>
+
+ #ifndef IF_NAMESIZE
+ #define IF_NAMESIZE 16
+@@ -635,6 +636,36 @@ netsnmp_arch_interface_container_load(netsnmp_container* container,
+ entry->type = IANAIFTYPE_OTHER;
+ }
+
++ /*
++ * interface identifier is specified based on physaddr and type
++ */
++ switch (entry->type) {
++ case IANAIFTYPE_ETHERNETCSMACD:
++ case IANAIFTYPE_ETHERNET3MBIT:
++ case IANAIFTYPE_FASTETHER:
++ case IANAIFTYPE_FASTETHERFX:
++ case IANAIFTYPE_GIGABITETHERNET:
++ case IANAIFTYPE_FDDI:
++ case IANAIFTYPE_ISO88025TOKENRING:
++ if (NULL != entry->paddr && ETH_ALEN != entry->paddr_len)
++ break;
++
++ entry->v6_if_id_len = entry->paddr_len + 2;
++ memcpy(entry->v6_if_id, entry->paddr, 3);
++ memcpy(entry->v6_if_id + 5, entry->paddr + 3, 3);
++ entry->v6_if_id[0] ^= 2;
++ entry->v6_if_id[3] = 0xFF;
++ entry->v6_if_id[4] = 0xFE;
++
++ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID;
++ break;
++
++ case IANAIFTYPE_SOFTWARELOOPBACK:
++ entry->v6_if_id_len = 0;
++ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID;
++ break;
++ }
++
+ if (IANAIFTYPE_ETHERNETCSMACD == entry->type)
+ entry->speed =
+ netsnmp_linux_interface_get_if_speed(fd, entry->name);
+--
+1.6.0.2
+
|
[-]
[+]
|
Added |
Fix-for-Internet-Address-Prefix-Table.patch
^
|
@@ -0,0 +1,876 @@
+From 71ffec9f8c1bcd14a7bf6ca7762bc121ba1efaf1 Mon Sep 17 00:00:00 2001
+From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+Date: Mon, 20 Oct 2008 17:42:57 +0900
+Subject: [PATCH] Fix for Internet Address Prefix Table
+
+From net-snmp patch tracker:
+[ 1705594 ] ipAddressPrefixTable Fixes
+http://sourceforge.net/tracker/index.php?func=detail&aid=1705594&group_id=12694&atid=312694
+
+[ 1902105 ] hide some log messages introduced by patch 1705594
+http://sourceforge.net/tracker/index.php?func=detail&aid=1902105&group_id=12694&atid=312694
+
+Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+---
+ .../mibgroup/if-mib/data_access/interface_linux.c | 186 ++++++++++++++++++++
+ .../mibgroup/ip-mib/data_access/ipaddress_common.c | 67 +++++++
+ .../mibgroup/ip-mib/data_access/ipaddress_linux.c | 144 +++++++++++++++-
+ .../ipAddressPrefixTable/ipAddressPrefixTable.c | 7 +-
+ .../ipAddressPrefixTable_constants.h | 14 ++
+ .../ipAddressPrefixTable_data_access.c | 27 +++-
+ agent/mibgroup/util_funcs.c | 152 ++++++++++++++++-
+ agent/mibgroup/util_funcs.h | 41 +++++
+ include/net-snmp/data_access/ipaddress.h | 19 ++-
+ 9 files changed, 645 insertions(+), 12 deletions(-)
+
+diff --git a/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c
+index 474a904..294963a 100644
+--- a/agent/mibgroup/if-mib/data_access/interface_linux.c
++++ b/agent/mibgroup/if-mib/data_access/interface_linux.c
+@@ -29,6 +29,7 @@ typedef __u8 u8; /* ditto */
+ #include <net-snmp/data_access/interface.h>
+ #include <net-snmp/data_access/ipaddress.h>
+ #include "if-mib/data_access/interface.h"
++#include "mibgroup/util_funcs.h"
+ #include "interface_ioctl.h"
+
+ #include <sys/types.h>
+@@ -42,6 +43,15 @@ typedef __u8 u8; /* ditto */
+ #define IF_NAMESIZE 16
+ #endif
+
++#ifdef NETSNMP_ENABLE_IPV6
++#if defined(HAVE_PTHREAD_H) && defined(HAVE_LINUX_RTNETLINK_H)
++#include <pthread.h>
++#include <linux/rtnetlink.h>
++#ifdef RTMGRP_IPV6_PREFIX
++#define SUPPORT_PREFIX_FLAGS 1
++#endif /* RTMGRP_IPV6_PREFIX */
++#endif /* HAVE_PTHREAD_H && HAVE_LINUX_RTNETLINK_H */
++#endif /* NETSNMP_ENABLE_IPV6 */
+ unsigned int
+ netsnmp_linux_interface_get_if_speed(int fd, const char *name);
+ #ifdef HAVE_LINUX_ETHTOOL_H
+@@ -59,6 +69,16 @@ static unsigned short retrans_time_factor = 1;
+ #define PROC_SYS_NET_IPVx_BASE_REACHABLE_TIME "/proc/sys/net/ipv%d/neigh/%s/base_reachable_time"
+ static const char *proc_sys_basereachable_time;
+ static unsigned short basereachable_time_ms = 0;
++#ifdef SUPPORT_PREFIX_FLAGS
++prefix_cbx *prefix_head_list = NULL;
++pthread_mutex_t prefix_mutex_lock = PTHREAD_MUTEX_INITIALIZER;
++netsnmp_prefix_listen_info list_info;
++pthread_t thread1;
++#define IF_PREFIX_ONLINK 0x01
++#define IF_PREFIX_AUTOCONF 0x02
++
++void *netsnmp_prefix_listen(netsnmp_prefix_listen_info *listen_info);
++#endif
+ void
+ netsnmp_arch_interface_init(void)
+ {
+@@ -91,6 +111,13 @@ netsnmp_arch_interface_init(void)
+ else {
+ proc_sys_basereachable_time = PROC_SYS_NET_IPVx_BASE_REACHABLE_TIME;
+ }
++#ifdef SUPPORT_PREFIX_FLAGS
++ list_info.list_head = &prefix_head_list;
++ list_info.lockinfo = &prefix_mutex_lock;
++
++ if(pthread_create(&thread1, NULL, netsnmp_prefix_listen, &list_info) < 0)
++ snmp_log(LOG_ERR,"Unable to create thread\n");
++#endif
+ }
+
+ /*
+@@ -885,3 +912,162 @@ netsnmp_linux_interface_get_if_speed(int fd, const char *name)
+ }
+ return retspeed;
+ }
++#ifdef SUPPORT_PREFIX_FLAGS
++void *netsnmp_prefix_listen(netsnmp_prefix_listen_info *listen_info)
++{
++ struct {
++ struct nlmsghdr n;
++ struct ifinfomsg r;
++ char buf[1024];
++ } req;
++
++ struct rtattr *rta;
++ int status;
++ char buf[16384];
++ struct nlmsghdr *nlmp;
++ struct rtattr *rtatp;
++ struct in6_addr *in6p;
++ struct sockaddr_nl localaddrinfo;
++ struct ifaddrmsg *ifa;
++ struct prefixmsg *prefix;
++ unsigned groups = 0;
++ struct rtattr *index_table[IFA_MAX+1];
++ char in6pAddr[40];
++ int flag1 = 0,flag2 = 0;
++ int onlink = 2,autonomous = 2; /*Assume as false*/
++ prefix_cbx *new;
++ int iret;
++ int len, req_len, length;
++ int fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
++
++
++ memset(&localaddrinfo, 0, sizeof(struct sockaddr_nl));
++ memset(&in6pAddr, '\0', sizeof(in6pAddr));
++
++ groups |= RTMGRP_IPV6_IFADDR;
++ groups |= RTMGRP_IPV6_PREFIX;
++ localaddrinfo.nl_family = AF_NETLINK;
++ localaddrinfo.nl_groups = groups;
++
++ if (bind(fd, (struct sockaddr*)&localaddrinfo, sizeof(localaddrinfo)) < 0) {
++ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Bind failed. Exiting thread.\n");
++ exit(0);
++ }
++
++ memset(&req, 0, sizeof(req));
++ req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
++ req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT;
++ req.n.nlmsg_type = RTM_GETLINK;
++ req.r.ifi_family = AF_INET6;
++ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.n.nlmsg_len));
++ rta->rta_len = RTA_LENGTH(16);
++
++ status = send(fd, &req, req.n.nlmsg_len, 0);
++ if (status < 0) {
++ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Send failed. Exiting thread\n");
++ exit(0);
++ }
++
++ while(1) {
++ status = recv(fd, buf, sizeof(buf), 0);
++ if (status < 0) {
++ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Recieve failed. Exiting thread\n");
++ exit(0);
++ }
++
++ if(status == 0){
++ DEBUGMSGTL(("access:interface:prefix", "End of File\n"));
++ continue;
++ }
++
++ for(nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp);){
++ len = nlmp->nlmsg_len;
++ req_len = len - sizeof(*nlmp);
++
++ if (req_len < 0 || len > status) {
++ snmp_log(LOG_ERR,"netsnmp_prefix_listen: Error in length. Exiting thread\n");
++ exit(0);
++ }
++
++ if (!NLMSG_OK(nlmp, status)) {
++ DEBUGMSGTL(("access:interface:prefix", "NLMSG not OK\n"));
++ continue;
++ }
++
++ if (nlmp->nlmsg_type == RTM_NEWADDR || nlmp->nlmsg_type == RTM_DELADDR) {
++ ifa = NLMSG_DATA(nlmp);
++ length = nlmp->nlmsg_len;
++ length -= NLMSG_LENGTH(sizeof(*ifa));
++
++ if (length < 0) {
++ DEBUGMSGTL(("access:interface:prefix", "wrong nlmsg length %d\n", length));
++ continue;
++ }
++ memset(index_table, 0, sizeof(struct rtattr *) * (IFA_MAX + 1));
++ if(!ifa->ifa_flags) {
++ rtatp = IFA_RTA(ifa);
++ while (RTA_OK(rtatp, length)) {
++ if (rtatp->rta_type <= IFA_MAX)
++ index_table[rtatp->rta_type] = rtatp;
++ rtatp = RTA_NEXT(rtatp,length);
++ }
++ if (index_table[IFA_ADDRESS]) {
++ in6p = (struct in6_addr *)RTA_DATA(index_table[IFA_ADDRESS]);
++ if(nlmp->nlmsg_type == RTM_DELADDR) {
++ sprintf(in6pAddr, "%04x%04x%04x%04x%04x%04x%04x%04x", NIP6(*in6p));
++ flag1 = -1;
++ } else {
++ sprintf(in6pAddr, "%04x%04x%04x%04x%04x%04x%04x%04x", NIP6(*in6p));
++ flag1 = 1;
++ }
++
++ }
++ }
|
[-]
[+]
|
Added |
Fix-for-Internet-Address-Table.patch
^
|
@@ -0,0 +1,405 @@
+From 12cb1f471833a7e145bdf7cb4d471d0bd74d73f0 Mon Sep 17 00:00:00 2001
+From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+Date: Mon, 20 Oct 2008 16:08:06 +0900
+Subject: [PATCH] Fix for Internet Address Table
+
+From net-snmp patch tracker:
+[ 1692817 ] ipAddressTable fixes
+http://sourceforge.net/tracker/index.php?func=detail&aid=1692817&group_id=12694&atid=312694
+
+[ 1712645 ] meaningful log message on duplicate IP address
+http://sourceforge.net/tracker/index.php?func=detail&aid=1712645&group_id=12694&atid=312694
+
+[ 1810660 ] Fix broadcast addresses in ipAddressTable on 64 bit
+linux
+http://sourceforge.net/tracker/index.php?func=detail&aid=1810660&group_id=12694&atid=312694
+
+Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+---
+ .../mibgroup/ip-mib/data_access/ipaddress_ioctl.c | 63 +++++++++-
+ .../mibgroup/ip-mib/data_access/ipaddress_ioctl.h | 13 ++
+ .../mibgroup/ip-mib/data_access/ipaddress_linux.c | 121 ++++++++++++++++++--
+ .../ip-mib/ipAddressTable/ipAddressTable.c | 5 +-
+ include/net-snmp/library/container.h | 2 +-
+ snmplib/container.c | 2 +-
+ 6 files changed, 189 insertions(+), 17 deletions(-)
+
+diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
+index d5e78f0..085653d 100644
+--- a/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
++++ b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
+@@ -135,7 +135,9 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ struct ifreq *ifrp;
+ struct sockaddr save_addr;
+ struct sockaddr_in * si;
+- netsnmp_ipaddress_entry *entry;
++ netsnmp_ipaddress_entry *entry, *bcastentry;
++ struct address_flag_info addr_info;
++ in_addr_t ipval;
+ _ioctl_extras *extras;
+
+ if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+@@ -184,6 +186,7 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ netsnmp_assert(AF_INET == ifrp->ifr_addr.sa_family);
+ si = (struct sockaddr_in *) &ifrp->ifr_addr;
+ entry->ia_address_len = sizeof(si->sin_addr.s_addr);
++ ipval = si->sin_addr.s_addr;
+ memcpy(entry->ia_address, &si->sin_addr.s_addr,
+ entry->ia_address_len);
+
+@@ -220,6 +223,26 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ }
+
+ /*
++ * get broadcast
++ */
++ memset(&addr_info, 0, sizeof(struct address_flag_info));
++#if defined (NETSNMP_ENABLE_IPV6)
++ addr_info = netsnmp_access_other_info_get(entry->if_index, AF_INET);
++ if(addr_info.bcastflg) {
++ bcastentry = netsnmp_access_ipaddress_entry_create();
++ if(NULL == entry) {
++ rc = -3;
++ break;
++ }
++ bcastentry->if_index = entry->if_index;
++ bcastentry->ns_ia_index = ++idx_offset;
++ bcastentry->ia_address_len = sizeof(addr_info.inp->s_addr);
++ memcpy(bcastentry->ia_address, &addr_info.inp->s_addr,
++ bcastentry->ia_address_len);
++ }
++#endif
++
++ /*
+ * get netmask
+ */
+ ifrp->ifr_addr = save_addr;
+@@ -232,7 +255,10 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ netsnmp_assert(AF_INET == ifrp->ifr_addr.sa_family);
+ si = (struct sockaddr_in *) &ifrp->ifr_addr;
+ entry->ia_prefix_len =
+- netsnmp_ipaddress_ipv4_prefix_len(si->sin_addr.s_addr);
++ netsnmp_ipaddress_ipv4_prefix_len(ntohl(si->sin_addr.s_addr));
++ if(addr_info.bcastflg)
++ bcastentry->ia_prefix_len = entry->ia_prefix_len;
++
+
+ /*
+ * get flags
+@@ -246,7 +272,12 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ }
+ extras->flags = ifrp->ifr_flags;
+
+- entry->ia_type = IPADDRESSTYPE_UNICAST; /* assume unicast? */
++ if(addr_info.bcastflg)
++ bcastentry->ia_type = IPADDRESSTYPE_BROADCAST;
++ if(addr_info.anycastflg)
++ entry->ia_type = IPADDRESSTYPE_ANYCAST;
++ else
++ entry->ia_type = IPADDRESSTYPE_UNICAST;
+
+ /** entry->ia_prefix_oid ? */
+
+@@ -256,12 +287,23 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ * always preferred(1).
+ */
+ entry->ia_status = IPADDRESSSTATUSTC_PREFERRED;
++ if(addr_info.bcastflg)
++ bcastentry->ia_status = IPADDRESSSTATUSTC_PREFERRED;
+
+ /*
+ * can we figure out if an address is from DHCP?
+ * use manual until then...
+ */
+- entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
++ if(IS_APIPA(ipval)) {
++ entry->ia_origin = IPADDRESSORIGINTC_RANDOM;
++ if(addr_info.bcastflg)
++ bcastentry->ia_origin = IPADDRESSORIGINTC_RANDOM;
++ }
++ else {
++ entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
++ if(addr_info.bcastflg)
++ bcastentry->ia_origin = IPADDRESSORIGINTC_MANUAL;
++ }
+
+ DEBUGIF("access:ipaddress:container") {
+ DEBUGMSGT_NC(("access:ipaddress:container",
+@@ -279,12 +321,21 @@ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ /*
+ * add entry to container
+ */
+- if (CONTAINER_INSERT(container, entry) < 0)
+- {
++ if(addr_info.bcastflg){
++ if (CONTAINER_INSERT(container, bcastentry) < 0) {
++ DEBUGMSGTL(("access:ipaddress:container","error with ipaddress_entry: insert broadcast entry into container failed.\n"));
++ netsnmp_access_ipaddress_entry_free(bcastentry);
++ netsnmp_access_ipaddress_entry_free(entry);
++ continue;
++ }
++ }
++
++ if (CONTAINER_INSERT(container, entry) < 0) {
+ DEBUGMSGTL(("access:ipaddress:container","error with ipaddress_entry: insert into container failed.\n"));
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
++
+ }
+
+ /*
+diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h
+index a7a0ea2..fc9774f 100644
+--- a/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h
++++ b/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h
+@@ -2,6 +2,17 @@
+ extern "C" {
+ #endif
+
++/*
++ * struct for netlink extras
++ */
++struct address_flag_info {
++ int bcastflg;
++ int anycastflg;
++ struct in_addr *inp;
++};
++
++#define IS_APIPA(a) (((in_addr_t)(a << 16)) == 0xFEA90000)
++
+ int
+ _netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ int idx_offset);
+@@ -13,6 +24,8 @@ _netsnmp_ioctl_ipaddress_remove_v4(netsnmp_ipaddress_entry * entry);
+ int
+ netsnmp_access_ipaddress_ioctl_get_interface_count(int sd, struct ifconf * ifc);
+
++struct address_flag_info
++netsnmp_access_other_info_get(int index, int family);
+
+ /*
+ * struct ioctl for arch_data
+diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
+index 8cb06a2..ac37578 100644
+--- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
++++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
+@@ -19,6 +19,7 @@
+ #if defined (NETSNMP_ENABLE_IPV6)
+ #include <linux/types.h>
+ #include <asm/types.h>
++#include <linux/netlink.h>
+ #include <linux/rtnetlink.h>
+ #endif
+
+@@ -188,6 +189,7 @@ _load_v6(netsnmp_container *container, int idx_offset)
+ netsnmp_ipaddress_entry *entry;
+ _ioctl_extras *extras;
+ static int log_open_err = 1;
++ struct address_flag_info addr_info;
|
[-]
[+]
|
Added |
Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch
^
|
@@ -0,0 +1,368 @@
+From 757470fe3c79081b3b106f669f39e45f7aaa4baf Mon Sep 17 00:00:00 2001
+From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+Date: Mon, 20 Oct 2008 14:36:05 +0900
+Subject: [PATCH] Fix for tcpConnnectionTable, tcpListenerTable, udpEndpointTable
+
+From net-snmp patch tracker:
+[ 1670511 ] agent returns 0 for process id in tcp and udp mib
+http://sourceforge.net/tracker/index.php?func=detail&aid=1670511&group_id=12694&atid=312694
+
+Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+---
+ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c | 18 ++--
+ .../udp-mib/data_access/udp_endpoint_linux.c | 7 +-
+ .../udp-mib/udpEndpointTable/udpEndpointTable.c | 17 +++-
+ .../udp-mib/udpEndpointTable/udpEndpointTable.h | 12 ++-
+ .../udpEndpointTable_data_access.c | 3 +-
+ agent/mibgroup/util_funcs.c | 100 ++++++++++++++++++++
+ agent/mibgroup/util_funcs.h | 4 +
+ include/net-snmp/data_access/udp_endpoint.h | 1 +
+ 8 files changed, 146 insertions(+), 16 deletions(-)
+
+diff --git a/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c b/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c
+index 7ffebe6..72495a9 100644
+--- a/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c
++++ b/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c
+@@ -11,7 +11,7 @@
+
+ #include "tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h"
+ #include "tcp-mib/data_access/tcpConn_private.h"
+-
++#include "mibgroup/util_funcs.h"
+ static int
+ linux_states[12] = { 1, 5, 3, 4, 6, 7, 11, 1, 8, 9, 2, 10 };
+
+@@ -135,15 +135,16 @@ _load4(netsnmp_container *container, u_int load_flags)
+ while (fgets(line, sizeof(line), in)) {
+ netsnmp_tcpconn_entry *entry;
+ int state, rc, local_port, remote_port, tmp_state;
++ unsigned long long inode;
+ size_t buf_len, offset;
+ u_char local_addr[10], remote_addr[10];
+ u_char *tmp_ptr;
+
+- if (5 != (rc = sscanf(line, "%*d: %8[0-9A-Z]:%x %8[0-9A-Z]:%x %x",
++ if (6 != (rc = sscanf(line, "%*d: %8[0-9A-Z]:%x %8[0-9A-Z]:%x %x %*x:%*x %*x:%*x %*x %*x %*x %llu",
+ local_addr, &local_port,
+- remote_addr, &remote_port, &tmp_state))) {
++ remote_addr, &remote_port, &tmp_state, &inode))) {
+ DEBUGMSGT(("access:tcpconn:container",
+- "error parsing line (%d != 5)\n", rc));
++ "error parsing line (%d != 6)\n", rc));
+ DEBUGMSGT(("access:tcpconn:container"," line '%s'\n", line));
+ continue;
+ }
+@@ -180,6 +181,7 @@ _load4(netsnmp_container *container, u_int load_flags)
+ entry->loc_port = (unsigned short) local_port;
+ entry->rmt_port = (unsigned short) remote_port;
+ entry->tcpConnState = state;
++ entry->pid = get_pid_from_inode(inode);
+
+ /** the addr string may need work */
+ buf_len = strlen(local_addr);
+@@ -286,15 +288,16 @@ _load6(netsnmp_container *container, u_int load_flags)
+ while (fgets(line, sizeof(line), in)) {
+ netsnmp_tcpconn_entry *entry;
+ int state, rc, local_port, remote_port, tmp_state;
++ unsigned long long inode;
+ size_t buf_len, offset;
+ u_char local_addr[48], remote_addr[48];
+ u_char *tmp_ptr;
+
+- if (5 != (rc = sscanf(line, "%*d: %47[0-9A-Z]:%x %47[0-9A-Z]:%x %x",
++ if (6 != (rc = sscanf(line, "%*d: %47[0-9A-Z]:%x %47[0-9A-Z]:%x %x %*x:%*x %*x:%*x %*x %*x %*x %llu",
+ local_addr, &local_port,
+- remote_addr, &remote_port, &tmp_state))) {
++ remote_addr, &remote_port, &tmp_state, &inode))) {
+ DEBUGMSGT(("access:tcpconn:container",
+- "error parsing line (%d != 5)\n", rc));
++ "error parsing line (%d != 6)\n", rc));
+ DEBUGMSGT(("access:tcpconn:container"," line '%s'\n", line));
+ continue;
+ }
+@@ -331,6 +334,7 @@ _load6(netsnmp_container *container, u_int load_flags)
+ entry->loc_port = (unsigned short) local_port;
+ entry->rmt_port = (unsigned short) remote_port;
+ entry->tcpConnState = state;
++ entry->pid = get_pid_from_inode(inode);
+
+ /** the addr string may need work */
+ buf_len = strlen((char*)local_addr);
+diff --git a/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c b/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c
+index 4e43e01..70dcace 100644
+--- a/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c
++++ b/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c
+@@ -14,7 +14,7 @@
+ #include <net-snmp/data_access/udp_endpoint.h>
+
+ #include "udp-mib/udpEndpointTable/udpEndpointTable_constants.h"
+-
++#include "mibgroup/util_funcs.h"
+ #include "udp_endpoint_private.h"
+
+ #include <fcntl.h>
+@@ -222,6 +222,11 @@ _process_line_udp_ep(netsnmp_line_info *line_info, void *mem,
+ inode = strtoull(ptr, &ptr, 0);
+ ep->instance = (u_int)inode;
+
++ /*
++ * get the pid also
++ */
++ ep->pid = get_pid_from_inode(inode);
++
+ ep->index = (u_int)(lpi->user_context);
+ lpi->user_context = (void*)((u_int)(lpi->user_context) + 1);
+
+diff --git a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c
+index 5da022f..b2d8b23 100644
+--- a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c
++++ b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c
+@@ -223,7 +223,8 @@ udpEndpointTable_indexes_set_tbl_idx(udpEndpointTable_mib_index * tbl_idx,
+ size_t
+ udpEndpointRemoteAddress_val_ptr_len,
+ u_long udpEndpointRemotePort_val,
+- u_long udpEndpointInstance_val)
++ u_long udpEndpointInstance_val,
++ u_long udpEndpointProcess_val)
+ {
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_indexes_set_tbl_idx", "called\n"));
+
+@@ -292,6 +293,10 @@ udpEndpointTable_indexes_set_tbl_idx(udpEndpointTable_mib_index * tbl_idx,
+ * udpEndpointInstance(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h
+ */
+ tbl_idx->udpEndpointInstance = udpEndpointInstance_val;
++ /*
++ * udpEndpointProcess(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h
++ */
++ tbl_idx->udpEndpointProcess = udpEndpointProcess_val;
+
+
+ return MFD_SUCCESS;
+@@ -320,7 +325,8 @@ udpEndpointTable_indexes_set(udpEndpointTable_rowreq_ctx * rowreq_ctx,
+ char *udpEndpointRemoteAddress_val_ptr,
+ size_t udpEndpointRemoteAddress_val_ptr_len,
+ u_long udpEndpointRemotePort_val,
+- u_long udpEndpointInstance_val)
++ u_long udpEndpointInstance_val,
++ u_long udpEndpointProcess_val)
+ {
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_indexes_set",
+ "called\n"));
+@@ -335,7 +341,8 @@ udpEndpointTable_indexes_set(udpEndpointTable_rowreq_ctx * rowreq_ctx,
+ udpEndpointRemoteAddress_val_ptr,
+ udpEndpointRemoteAddress_val_ptr_len,
+ udpEndpointRemotePort_val,
+- udpEndpointInstance_val))
++ udpEndpointInstance_val,
++ udpEndpointProcess_val))
+ return MFD_ERROR;
+
+ /*
+@@ -402,9 +409,9 @@ udpEndpointProcess_get(udpEndpointTable_rowreq_ctx * rowreq_ctx,
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the udpEndpointProcess data.
+- * copy (* udpEndpointProcess_val_ptr ) from rowreq_ctx->data
++ * copy (* udpEndpointProcess_val_ptr ) from rowreq_ctx->tbl_idx.udpEndpointProcess
+ */
+- (*udpEndpointProcess_val_ptr) = rowreq_ctx->data.udpEndpointProcess;
++ (*udpEndpointProcess_val_ptr) = rowreq_ctx->tbl_idx.udpEndpointProcess;
+
+ return MFD_SUCCESS;
+ } /* udpEndpointProcess_get */
+diff --git a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+index f023db8..fce1659 100644
+--- a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
++++ b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+@@ -132,6 +132,11 @@ config_require(udp-mib/udpEndpointTable/udpEndpointTable_data_access)
+ */
+ u_long udpEndpointInstance;
+
++ /*
++ * udpEndpointProcess(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h
++ */
++ u_long udpEndpointProcess;
++
+
+ } udpEndpointTable_mib_index;
+
+@@ -257,7 +262,9 @@ config_require(udp-mib/udpEndpointTable/udpEndpointTable_data_access)
+ u_long
+ udpEndpointRemotePort_val,
+ u_long
+- udpEndpointInstance_val);
++ udpEndpointInstance_val,
++ u_long
++ udpEndpointProcess_val);
+ int
+ udpEndpointTable_indexes_set(udpEndpointTable_rowreq_ctx *
+ rowreq_ctx,
|
[-]
[+]
|
Added |
Improve-IP-Statistics-tables.patch
^
|
@@ -0,0 +1,7453 @@
+From 32c13f8502b9520a49fb88a6737801d705fcbb9f Mon Sep 17 00:00:00 2001
+From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+Date: Mon, 20 Oct 2008 17:57:27 +0900
+Subject: [PATCH] Improve IP Statistics tables
+
+This patch fixes the ipSystemStatsTable and adds ipIfStatsTable for IPv6.
+
+From net-snmp patch tracker:
+[ 1797111 ] Better support for ipIfStatsTable
+http://sourceforge.net/tracker/index.php?func=detail&aid=1797111&group_id=12694&atid=312694
+
+Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
+---
+ README.agent-mibs | 2 +-
+ .../ip-mib/data_access/systemstats_common.c | 119 +-
+ .../ip-mib/data_access/systemstats_linux.c | 389 +++-
+ agent/mibgroup/ip-mib/ipIfStatsTable.h | 8 +
+ .../ip-mib/ipIfStatsTable/ipIfStatsTable.c | 216 ++
+ .../ip-mib/ipIfStatsTable/ipIfStatsTable.h | 200 ++
+ .../ipIfStatsTable/ipIfStatsTable_data_access.c | 408 +++
+ .../ipIfStatsTable/ipIfStatsTable_data_access.h | 70 +
+ .../ipIfStatsTable/ipIfStatsTable_data_get.c | 3015 ++++++++++++++++++++
+ .../ipIfStatsTable/ipIfStatsTable_data_get.h | 246 ++
+ .../ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h | 56 +
+ .../ipIfStatsTable/ipIfStatsTable_interface.c | 1395 +++++++++
+ .../ipIfStatsTable/ipIfStatsTable_interface.h | 99 +
+ .../ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h | 122 +
+ .../ip-mib/ipSystemStatsTable/ipSystemStatsTable.c | 154 +-
+ .../ipSystemStatsTable_data_access.c | 60 +-
+ include/net-snmp/data_access/ipstats.h | 66 +-
+ include/net-snmp/data_access/systemstats.h | 14 +-
+ 18 files changed, 6494 insertions(+), 145 deletions(-)
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable.h
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.c
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable.h
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.c
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_access.h
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_enums.h
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.h
+ create mode 100644 agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_oids.h
+
+diff --git a/README.agent-mibs b/README.agent-mibs
+index 8716f8d..ff5ce6a 100644
+--- a/README.agent-mibs
++++ b/README.agent-mibs
+@@ -152,7 +152,7 @@ IP-MIB
+
+ ipSystemStatsTable L 5.2 M ip-mib/=/*
+ ipIfStatsTableLastChange.0 ---
+- ipIfStatsTable ---
++ ipIfStatsTable L-- 5.5 M ip-mib/=/*
+
+ ipAddrTable (D) U $2 4.2 O mibII/ipAddr.c
+ ipAddressSpinLock.0 ---
+diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_common.c b/agent/mibgroup/ip-mib/data_access/systemstats_common.c
+index 83e1867..a09cacf 100644
+--- a/agent/mibgroup/ip-mib/data_access/systemstats_common.c
++++ b/agent/mibgroup/ip-mib/data_access/systemstats_common.c
+@@ -1,5 +1,5 @@
+ /*
+- * Systemstats MIB architecture support
++ * ipSystemStatsTable and ipIfStatsTable MIB architecture support
+ *
+ * $Id: systemstats_common.c 11913 2005-02-08 21:58:36Z nba $
+ */
+@@ -163,7 +163,7 @@ netsnmp_access_systemstats_entry_get_by_index(netsnmp_container *container, oid
+ /**
+ */
+ netsnmp_systemstats_entry *
+-netsnmp_access_systemstats_entry_create(int version)
++netsnmp_access_systemstats_entry_create(int version, int if_index)
+ {
+ netsnmp_systemstats_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_systemstats_entry);
+@@ -173,10 +173,10 @@ netsnmp_access_systemstats_entry_create(int version)
+ if(NULL == entry)
+ return NULL;
+
+- entry->ns_ip_version = version;
+-
+- entry->oid_index.len = 1;
+- entry->oid_index.oids = (oid *) & entry->ns_ip_version;
++ entry->oid_index.len = 2;
++ entry->oid_index.oids = entry->index;
++ entry->index[0] = version;
++ entry->index[1] = if_index;
+
+ return entry;
+ }
+@@ -217,6 +217,64 @@ _entry_release(netsnmp_systemstats_entry * entry, void *context)
+ netsnmp_access_systemstats_entry_free(entry);
+ }
+
++/*
++ * Calculates the entries, which are not provided by OS, but can be
++ * computed from the others.
++ */
++static void
++_calculate_entries(netsnmp_systemstats_entry * entry)
++{
++ U64 calc_val;
++
++ /*
++ * HCInForwDatagrams = HCInNoRoutes + HCOutForwDatagrams
++ */
++ if (!entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS]
++ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS]
++ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES]) {
++
++ entry->stats.HCInForwDatagrams = entry->stats.HCInNoRoutes;
++ u64Incr(&entry->stats.HCInForwDatagrams, &entry->stats.HCOutForwDatagrams);
++ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS] = 1;
++ }
++
++ /*
++ * HCOutFragReqds = HCOutFragOKs + HCOutFragFails
++ */
++ if (!entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS]
++ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGOKS]
++ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGFAILS]) {
++
++ entry->stats.HCOutFragReqds = entry->stats.HCOutFragOKs;
++ u64Incr(&entry->stats.HCOutFragReqds, &entry->stats.HCOutFragFails);
++ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS] = 1;
++ }
++
++ /*
++ * HCOutTransmits = HCOutRequests + HCOutForwDatagrams + HCOutFragCreates
++ * - HCOutFragReqds - HCOutNoRoutes - HCOutDiscards
++ */
++ if (!entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS]
++ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTREQUESTS]
++ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS]
++ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGREQDS]
++ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTNOROUTES]
++ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES]
++ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS]) {
++
++ U64 tmp, tmp2, tmp3;
++ tmp = entry->stats.HCOutRequests;
++ u64Incr(&tmp, &entry->stats.HCOutForwDatagrams);
++ u64Incr(&tmp, &entry->stats.HCOutFragCreates);
++
++ u64Subtract(&tmp, &entry->stats.HCOutFragReqds, &tmp2);
++ u64Subtract(&tmp2, &entry->stats.HCOutNoRoutes, &tmp3);
++ u64Subtract(&tmp3, &entry->stats.HCOutDiscards, &entry->stats.HCOutTransmits);
++
++ entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTTRANSMITS] = 1;
++ }
++}
++
+ /**
+ * update entry stats (checking for counter wrap)
+ *
+@@ -233,7 +291,8 @@ netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_v
+ * sanity checks
+ */
+ if ((NULL == prev_vals) || (NULL == new_vals) ||
+- (prev_vals->ns_ip_version != new_vals->ns_ip_version))
++ (prev_vals->index[0] != new_vals->index[0])
++ || (prev_vals->index[1] != new_vals->index[1]))
+ return -1;
+
+ /*
+@@ -241,6 +300,7 @@ netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_v
+ */
+ if (0 == need_wrap_check) {
+ memcpy(&prev_vals->stats, &new_vals->stats, sizeof(new_vals->stats));
++ _calculate_entries(prev_vals);
+ return 0;
+ }
+
+@@ -257,8 +317,8 @@ netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_v
+ /*
+ * update straight 32 bit counters
+ */
++ memcpy(&prev_vals->stats.columnAvail[0], &new_vals->stats.columnAvail[0], sizeof(new_vals->stats.columnAvail));
+ prev_vals->stats.InHdrErrors = new_vals->stats.InHdrErrors;
+- prev_vals->stats.InNoRoutes = new_vals->stats.InNoRoutes;
+ prev_vals->stats.InAddrErrors = new_vals->stats.InAddrErrors;
+ prev_vals->stats.InUnknownProtos = new_vals->stats.InUnknownProtos;
+ prev_vals->stats.InTruncatedPkts = new_vals->stats.InTruncatedPkts;
+@@ -266,16 +326,38 @@ netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_v
+ prev_vals->stats.ReasmOKs = new_vals->stats.ReasmOKs;
+ prev_vals->stats.ReasmFails = new_vals->stats.ReasmFails;
+ prev_vals->stats.InDiscards = new_vals->stats.InDiscards;
+- prev_vals->stats.OutNoRoutes = new_vals->stats.OutNoRoutes;
+- prev_vals->stats.OutDiscards = new_vals->stats.OutDiscards;
+- prev_vals->stats.OutFragReqds = new_vals->stats.OutFragReqds;
+- prev_vals->stats.OutFragOKs = new_vals->stats.OutFragOKs;
+- prev_vals->stats.OutFragFails = new_vals->stats.OutFragFails;
+- prev_vals->stats.OutFragCreates = new_vals->stats.OutFragCreates;
+
+ /*
+ * update 64bit counters
+ */
|
[-]
[+]
|
Deleted |
bug-132316_net-snmp-5.1.3.1_order.patch
^
|
@@ -1,60 +0,0 @@
-Index: agent/mibgroup/agentx/master_admin.c
-===================================================================
---- agent/mibgroup/agentx/master_admin.c.orig 2005-08-17 14:36:13.000000000 +0200
-+++ agent/mibgroup/agentx/master_admin.c 2007-01-15 18:41:16.649892423 +0100
-@@ -130,14 +130,6 @@ close_agentx_session(netsnmp_session * s
-
- DEBUGMSGTL(("agentx/master", "close %08p, %d\n", session, sessid));
- if (session != NULL && sessid == -1) {
-- unregister_mibs_by_session(session);
-- unregister_index_by_session(session);
-- snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
-- SNMPD_CALLBACK_REQ_UNREG_SYSOR_SESS,
-- (void*)session);
-- if (session->myvoid != NULL) {
-- free(session->myvoid);
-- }
- /*
- * The following is necessary to avoid locking up the agent when
- * a sugagent dies during a set request. We must clean up the
-@@ -151,7 +143,12 @@ close_agentx_session(netsnmp_session * s
- netsnmp_remove_delegated_requests_for_session(subsession);
- }
- }
--
-+
-+ unregister_mibs_by_session(session);
-+ unregister_index_by_session(session);
-+ unregister_sysORTable_by_session(session);
-+ SNMP_FREE(session->myvoid);
-+
- return AGENTX_ERR_NOERROR;
- }
-
-Index: agent/mibgroup/agentx/master.c
-===================================================================
---- agent/mibgroup/agentx/master.c.orig 2005-08-17 14:36:13.000000000 +0200
-+++ agent/mibgroup/agentx/master.c 2007-01-15 18:39:59.033383576 +0100
-@@ -243,6 +243,11 @@ agentx_got_response(int operation,
- * probability is that the whole agent has died somehow.
- */
-
-+ netsnmp_handler_mark_requests_as_delegated(requests,
-+ REQUEST_IS_NOT_DELEGATED);
-+ netsnmp_set_request_error(cache->reqinfo, requests, /* XXXWWW: should be index=0 */
-+ SNMP_ERR_GENERR);
-+
- if (s != NULL) {
- netsnmp_transport *t = snmp_sess_transport(s);
- close_agentx_session(session, -1);
-@@ -256,10 +261,6 @@ agentx_got_response(int operation,
- } else {
- DEBUGMSGTL(("agentx/master", "NULL sess_pointer??\n"));
- }
-- netsnmp_handler_mark_requests_as_delegated(requests,
-- REQUEST_IS_NOT_DELEGATED);
-- netsnmp_set_request_error(cache->reqinfo, requests, /* XXXWWW: should be index=0 */
-- SNMP_ERR_GENERR);
- ax_session = (netsnmp_session *) cache->localinfo;
- netsnmp_free_agent_snmp_session_by_session(ax_session, NULL);
- netsnmp_free_delegated_cache(cache);
|
[-]
[+]
|
Deleted |
bug-361495_proxy-free.diff
^
|
@@ -1,10 +0,0 @@
---- agent/mibgroup/ucd-snmp/proxy.c.orig 2008-02-13 13:13:04.000000000 +0100
-+++ agent/mibgroup/ucd-snmp/proxy.c 2008-02-13 13:13:12.000000000 +0100
-@@ -524,7 +524,6 @@
- DEBUGMSGTL(("proxy", " ignoring error response\n"));
- netsnmp_handler_mark_requests_as_delegated(requests,
- REQUEST_IS_NOT_DELEGATED);
-- netsnmp_free_delegated_cache(cache);
- }
- else
- netsnmp_set_request_error(cache->reqinfo, requests, pdu->errstat);
|
[-]
[+]
|
Changed |
net-snmp-5.1.1-pie.patch
^
|
@@ -1,26 +1,26 @@
Index: apps/Makefile.in
===================================================================
---- apps/Makefile.in.orig
-+++ apps/Makefile.in
-@@ -111,7 +111,7 @@
- $(LINK) -o $@ snmptest.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+--- apps/Makefile.in.orig 2007-06-30 00:18:27.000000000 +0200
++++ apps/Makefile.in 2007-07-02 19:29:01.672262509 +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) -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) $(LOCAL_LIBS) ${LDFLAGS} ${TRAPLIBS}
-+ $(LINK) -o $@ -pie $(TRAPD_OBJECTS) $(INSTALLLIBS) $(LOCAL_LIBS) ${LDFLAGS} ${TRAPLIBS}
+- $(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) -o $@ snmptrap.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
Index: agent/Makefile.in
===================================================================
---- agent/Makefile.in.orig
-+++ agent/Makefile.in
-@@ -129,7 +129,7 @@
+--- agent/Makefile.in.orig 2007-06-30 00:18:27.000000000 +0200
++++ agent/Makefile.in 2007-07-02 19:29:28.297866574 +0200
+@@ -139,7 +139,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c
$(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $?
- snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(HELPERLIB) $(LIBTARG) ${INSTALLLIBS}
+ snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG)
- $(LINK) $(CFLAGS) -o $@ ${LAGENTOBJS} $(LOCAL_LIBS) ${LDFLAGS} ${OUR_AGENT_LIBS}
+ $(LINK) $(CFLAGS) -o $@ -pie ${LAGENTOBJS} $(LOCAL_LIBS) ${LDFLAGS} ${OUR_AGENT_LIBS}
- libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS}
+ libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS)
|
[-]
[+]
|
Deleted |
net-snmp-5.2.1-acinclude.diff
^
|
@@ -1,197 +0,0 @@
---- acinclude.m4
-+++ acinclude.m4
-@@ -0,0 +1,194 @@
-+dnl @synopsis AC_PROMPT_USER_NO_DEFINE(VARIABLENAME,QUESTION,[DEFAULT])
-+dnl
-+dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional
-+dnl DEFAULT value if the user merely hits return.
-+dnl
-+dnl @version 1.15
-+dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
-+dnl
-+AC_DEFUN([AC_PROMPT_USER_NO_DEFINE],
-+dnl changequote(<<, >>) dnl
-+dnl <<
-+[
-+if test "x$defaults" = "xno"; then
-+echo $ECHO_N "$2 ($3): $ECHO_C"
-+read tmpinput
-+if test "$tmpinput" = "" -a "$3" != ""; then
-+ tmpinput="$3"
-+fi
-+eval $1=\"$tmpinput\"
-+else
-+tmpinput="$3"
-+eval $1=\"$tmpinput\"
-+fi
-+]
-+dnl >>
-+dnl changequote([, ])
-+) dnl done AC_PROMPT_USER
-+
-+dnl @synopsis AC_PROMPT_USER(VARIABLENAME,QUESTION,[DEFAULT],QUOTED)
-+dnl
-+dnl Asks a QUESTION and puts the results in VARIABLENAME with an optional
-+dnl DEFAULT value if the user merely hits return. Also calls
-+dnl AC_DEFINE_UNQUOTED() on the VARIABLENAME for VARIABLENAMEs that should
-+dnl be entered into the config.h file as well. If QUOTED is "quoted" then
-+dnl the result will be defined within quotes.
-+dnl
-+dnl @version 1.15
-+dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
-+dnl
-+AC_DEFUN([AC_PROMPT_USER],
-+[
-+MSG_CHECK=`echo "$2" | tail -n 1`
-+AC_CACHE_CHECK($MSG_CHECK, ac_cv_user_prompt_$1,
-+[echo "" >&AC_FD_MSG
-+AC_PROMPT_USER_NO_DEFINE($1,[$2],$3)
-+eval ac_cv_user_prompt_$1=\$$1
-+echo $ECHO_N "setting $MSG_CHECK to... $ECHO_C" >&AC_FD_MSG
-+])
-+if test "$ac_cv_user_prompt_$1" != "none"; then
-+ if test "x$4" = "xquoted" -o "x$4" = "xQUOTED"; then
-+ AC_DEFINE_UNQUOTED($1,"$ac_cv_user_prompt_$1")
-+ else
-+ AC_DEFINE_UNQUOTED($1,$ac_cv_user_prompt_$1)
-+ fi
-+fi
-+]) dnl
-+
-+dnl @synopsis AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no])
-+dnl
-+dnl Checks STRUCT for MEMBER and defines DEFINE if found.
-+dnl
-+dnl @version 1.15
-+dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
-+dnl
-+AC_DEFUN(AC_CHECK_STRUCT_FOR,[
-+
-+ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'`
-+ac_safe_member=`echo "$3" | sed 'y%./+-%__p_%'`
-+ac_safe_all="ac_cv_struct_${ac_safe_struct}_has_${ac_safe_member}"
-+changequote(, )dnl
-+ ac_uc_define=STRUCT_`echo "${ac_safe_struct}_HAS_${ac_safe_member}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-+changequote([, ])dnl
-+
-+AC_MSG_CHECKING([for $2.$3])
-+AC_CACHE_VAL($ac_safe_all,
-+[
-+if test "x$4" = "x"; then
-+ defineit="= 0"
-+elif test "x$4" = "xno"; then
-+ defineit=""
-+else
-+ defineit="$4"
-+fi
-+AC_TRY_COMPILE([
-+$1
-+],[
-+struct $2 testit;
-+testit.$3 $defineit;
-+], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" )
-+])
-+
-+if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then
-+ AC_MSG_RESULT(yes)
-+ AC_DEFINE_UNQUOTED($ac_uc_define)
-+else
-+ AC_MSG_RESULT(no)
-+fi
-+
-+])
-+
-+dnl AC_CHECK_IFNET_FOR(SUBSTRUCT,[no])
-+AC_DEFUN(AC_CHECK_IFNET_FOR,[
-+dnl check for $1 in struct ifnet
-+AC_CHECK_STRUCT_FOR([
-+#ifdef IFNET_NEEDS_KERNEL
-+#define _KERNEL 1
-+#endif
-+#include <sys/types.h>
-+#include <sys/socket.h>
-+#ifdef HAVE_SYS_TIME_H
-+#include <sys/time.h>
-+#endif
-+#include <net/if.h>
-+#ifdef HAVE_NET_IF_VAR_H
-+#include <net/if_var.h>
-+#endif
-+#ifdef HAVE_SYS_QUEUE_H
-+#include <sys/queue.h>
-+#endif
-+#ifdef linux
-+struct ifnet {
-+ char *if_name; /* name, e.g. "en" or "lo" */
-+ short if_unit; /* sub-unit for lower level driver */
-+ short if_mtu; /* maximum transmission unit */
-+ short if_flags; /* up/down, broadcast, etc. */
-+ int if_metric; /* routing metric (external only) */
-+ char if_hwaddr [6]; /* ethernet address */
-+ int if_type; /* interface type: 1=generic,
-+ 28=slip, ether=6, loopback=24 */
-+ int if_speed; /* interface speed: in bits/sec */
-+
-+ struct sockaddr if_addr; /* interface's address */
-+ struct sockaddr ifu_broadaddr; /* broadcast address */
-+ struct sockaddr ia_subnetmask; /* interface's mask */
-+
-+ struct ifqueue {
-+ int ifq_len;
-+ int ifq_drops;
-+ } if_snd; /* output queue */
-+ int if_ibytes; /* octets received on interface */
-+ int if_ipackets; /* packets received on interface */
-+ int if_ierrors; /* input errors on interface */
-+ int if_iqdrops; /* input queue overruns */
-+ int if_obytes; /* octets sent on interface */
-+ int if_opackets; /* packets sent on interface */
-+ int if_oerrors; /* output errors on interface */
-+ int if_collisions; /* collisions on csma interfaces */
-+/* end statistics */
-+ struct ifnet *if_next;
-+};
-+#endif
-+], ifnet, $1, $2)
-+])
-+
-+dnl
-+dnl Add a search path to the LIBS and CFLAGS variables
-+dnl
-+AC_DEFUN(AC_ADD_SEARCH_PATH,[
-+ if test "x$1" != x -a -d $1; then
-+ if test -d $1/lib; then
-+ LDFLAGS="-L$1/lib $LDFLAGS"
-+ fi
-+ if test -d $1/include; then
-+ CPPFLAGS="-I$1/include $CPPFLAGS"
-+ fi
-+ fi
-+])
-+
-+dnl
-+dnl Store information for displaying later.
-+dnl
-+AC_DEFUN(AC_MSG_CACHE_INIT,[
-+ rm -f configure-summary
-+])
-+
-+AC_DEFUN(AC_MSG_CACHE_ADD,[
-+ cat >> configure-summary << EOF
-+ $1
-+EOF
-+])
-+
-+AC_DEFUN(AC_MSG_CACHE_DISPLAY,[
-+ echo ""
-+ echo "---------------------------------------------------------"
-+ echo " Net-SNMP configuration summary:"
-+ echo "---------------------------------------------------------"
-+ echo ""
-+ cat configure-summary
-+ echo ""
-+ echo "---------------------------------------------------------"
-+ echo ""
-+])
-+
-+
|
[-]
[+]
|
Deleted |
net-snmp-5.2.1-acquotation.patch
^
|
@@ -1,50 +0,0 @@
---- acinclude.m4
-+++ acinclude.m4
-@@ -62,7 +62,7 @@
- dnl @version 1.15
- dnl @author Wes Hardaker <hardaker@users.sourceforge.net>
- dnl
--AC_DEFUN(AC_CHECK_STRUCT_FOR,[
-+AC_DEFUN([AC_CHECK_STRUCT_FOR],[
-
- ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'`
- ac_safe_member=`echo "$3" | sed 'y%./+-%__p_%'`
-@@ -99,7 +99,7 @@
- ])
-
- dnl AC_CHECK_IFNET_FOR(SUBSTRUCT,[no])
--AC_DEFUN(AC_CHECK_IFNET_FOR,[
-+AC_DEFUN([AC_CHECK_IFNET_FOR],[
- dnl check for $1 in struct ifnet
- AC_CHECK_STRUCT_FOR([
- #ifdef IFNET_NEEDS_KERNEL
-@@ -155,7 +155,7 @@
- dnl
- dnl Add a search path to the LIBS and CFLAGS variables
- dnl
--AC_DEFUN(AC_ADD_SEARCH_PATH,[
-+AC_DEFUN([AC_ADD_SEARCH_PATH],[
- if test "x$1" != x -a -d $1; then
- if test -d $1/lib; then
- LDFLAGS="-L$1/lib $LDFLAGS"
-@@ -169,17 +169,17 @@
- dnl
- dnl Store information for displaying later.
- dnl
--AC_DEFUN(AC_MSG_CACHE_INIT,[
-+AC_DEFUN([AC_MSG_CACHE_INIT],[
- rm -f configure-summary
- ])
-
--AC_DEFUN(AC_MSG_CACHE_ADD,[
-+AC_DEFUN([AC_MSG_CACHE_ADD],[
- cat >> configure-summary << EOF
- $1
- EOF
- ])
-
--AC_DEFUN(AC_MSG_CACHE_DISPLAY,[
-+AC_DEFUN([AC_MSG_CACHE_DISPLAY],[
- echo ""
- echo "---------------------------------------------------------"
- echo " Net-SNMP configuration summary:"
|
[-]
[+]
|
Deleted |
net-snmp-5.2.1-autoconf.diff
^
|
@@ -1,50 +0,0 @@
-Index: configure.in
-===================================================================
---- configure.in.orig
-+++ configure.in
-@@ -943,8 +943,8 @@
- AC_EXEEXT
-
- # libtool stuff for shared/static libraries.
--AC_LIBTOOL_DLOPEN
- AC_LIBTOOL_WIN32_DLL
-+AC_LIBTOOL_DLOPEN
- AC_PROG_LIBTOOL
- AC_SUBST(LIBTOOL_DEPS)
-
-@@ -1037,7 +1037,7 @@
-
-
- # system check
--AC_CANONICAL_TARGET
-+AC_CANONICAL_TARGET([])
- changequote(, )
- PARTIALTARGETOS=`echo $target_os | sed 's/[-._].*//'`
- if test "x$PARTIALTARGETOS" = "xmingw32msvc"; then
-@@ -2332,8 +2332,6 @@
- [
- AC_MSG_RESULT([no])
- # Linux RedHat 6.1 won't link libwrap without libnsl
-- AC_CHECK_FUNC(yp_get_default_domain, ,
-- AC_CHECK_LIB(nsl, yp_get_default_domain))
- AC_MSG_CHECKING([for TCP wrappers library -lwrap linked with -lnsl])
- AC_TRY_LINK([#include <sys/types.h>
- #include <tcpd.h>
-@@ -3754,7 +3752,7 @@
- # we need to have a local variable `hz' in scope and set to a useful
- # value whenever we use one of these constants.
- #
--AC_CACHE_CHECK(whether TCP timers depend on \`hz',ac_cv_TCPTV_NEEDS_HZ,
-+AC_CACHE_CHECK(whether TCP timers depend on hz,ac_cv_TCPTV_NEEDS_HZ,
- [AC_EGREP_CPP(hz,
- [#include <netinet/tcp_timer.h>
- TCPTV_SRTTDFLT
-@@ -3808,7 +3806,7 @@
-
- ME=`$WHOAMI`
- if test -f /etc/resolv.conf; then
-- LOC=`cat /etc/resolv.conf | grep '^domain' | tail -1 | awk '{print $NF}'`
-+ LOC=`cat /etc/resolv.conf | grep '^domain' | tail -n 1 | awk '{print $NF}'`
- else
- LOC="@no.where"
- fi
|
[-]
[+]
|
Deleted |
net-snmp-5.2.1-compat.patch
^
|
@@ -1,10 +0,0 @@
---- include/ucd-snmp/util_funcs.h
-+++ include/ucd-snmp/util_funcs.h
-@@ -1,6 +1,6 @@
- #ifdef UCD_COMPATIBLE
-
--#include <net-snmp/util_funcs.h>
-+#include <net-snmp/utilities.h>
-
- #else
-
|
[-]
[+]
|
Deleted |
net-snmp-5.2.1-localperl.diff
^
|
@@ -1,10 +0,0 @@
-Index: local/snmpcheck.def
-===================================================================
---- local/snmpcheck.def.orig
-+++ local/snmpcheck.def
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/perl -w
-+#!/usr/bin/perl -w
-
- use strict 'refs';
- require Net::Ping;
|
[-]
[+]
|
Deleted |
net-snmp-5.2.1-overflow.diff
^
|
@@ -1,20 +0,0 @@
---- snmplib/mib.c.xx 2005-02-02 21:14:34.167265497 +0100
-+++ snmplib/mib.c 2005-02-02 21:15:40.937887906 +0100
-@@ -1521,7 +1521,7 @@
- return 0;
- }
- } else {
-- sprintf(tmp, "%lu", *var->val.integer);
-+ sprintf(tmp, "%u", (unsigned int)(*var->val.integer & 0xffffffff));
- if (!snmp_strcat
- (buf, buf_len, out_len, allow_realloc, (const u_char *) tmp)) {
- return 0;
-@@ -1585,7 +1585,7 @@
- return 0;
- }
- }
-- sprintf(tmp, "%lu", *var->val.integer);
-+ sprintf(tmp, "%u", (unsigned int)(*var->val.integer & 0xffffffff));
- if (!snmp_strcat
- (buf, buf_len, out_len, allow_realloc, (const u_char *) tmp)) {
- return 0;
|
[-]
[+]
|
Deleted |
net-snmp-5.2.1-perl.diff
^
|
@@ -1,11 +0,0 @@
---- perl/SNMP/t/startagent.pl
-+++ perl/SNMP/t/startagent.pl
-@@ -2,7 +2,7 @@
- $agent_host = 'localhost';
- $agent_port = 8765;
- $trap_port = 8764;
--$mibdir = '/usr/local/share/snmp/mibs';
-+$mibdir = '/usr/share/snmp/mibs';
- $comm = 'v1_private';
- $comm2 = 'v2c_private';
- $comm3 = 'v3_private';
|
[-]
[+]
|
Changed |
net-snmp-5.2.1-socket_path.diff
^
|
@@ -1,11 +1,13 @@
---- agent/mibgroup/agentx/protocol.h
+Index: agent/mibgroup/agentx/protocol.h
+===================================================================
+--- agent/mibgroup/agentx/protocol.h.orig
+++ agent/mibgroup/agentx/protocol.h
-@@ -10,7 +10,7 @@
- */
+@@ -13,7 +13,7 @@ extern "C" {
#define AGENTX_PORT 705
--#define AGENTX_SOCKET "/var/agentx/master"
-+#define AGENTX_SOCKET "/var/run/agentx/master"
+ #ifndef NETSNMP_AGENTX_SOCKET
+-#define NETSNMP_AGENTX_SOCKET "/var/agentx/master"
++#define NETSNMP_AGENTX_SOCKET "/var/run/agentx/master"
+ #endif
/*
- * AgentX versions
|
[-]
[+]
|
Deleted |
net-snmp-5.2.1-versinfo.diff
^
|
@@ -1,13 +0,0 @@
---- agent/mibgroup/ucd-snmp/versioninfo.c
-+++ agent/mibgroup/ucd-snmp/versioninfo.c
-@@ -130,8 +130,8 @@
- case VERCONFIG:
- #ifdef CONFIGURE_OPTIONS
- *var_len = strlen(config_opts);
-- if (*var_len > 1024)
-- *var_len = 1024; /* mib imposed restriction */
-+ if (*var_len > 300)
-+ *var_len = 300; /* mib imposed restriction */
- return (u_char *) config_opts;
- #else
- sprintf(errmsg, "");
|
[-]
[+]
|
Deleted |
net-snmp-5.2.1.testing.empty_arptable.patch
^
|
@@ -1,95 +0,0 @@
---- testing/rfc1213/snmpfun.sh
-+++ testing/rfc1213/snmpfun.sh
-@@ -1,4 +1,3 @@
--
- # functions used by RFC-1213 MIB test modules
-
- myport=$SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT
-@@ -11,6 +10,23 @@
- TEST_AUTHPRIV_PARMS="-l authNoPriv -a MD5 -A testpass"
- fi
-
-+check_skip_arp_tests ()
-+{
-+ #
-+ # skip all tests relying on a filed arp table. e.g. on s390 boxes this
-+ # does not have to be the case
-+ #
-+ TABLE_ENTRIES="at.atTable ip.ipNetToMediaTable"
-+ ARP_COUNT=`/sbin/arp | grep -v incomplete | wc -l`
-+ for entry in $TABLE_ENTRIES ; do
-+ if [ "x$1" == "x$entry" -a $ARP_COUNT == 0 ] ; then
-+ echo "skipping $1, because the arp table is empty." >&2
-+ return 0
-+ fi
-+ done
-+ return 1
-+}
-+
- config()
- {
- rm -f $SNMP_CONFIG_FILE
-@@ -54,25 +70,35 @@
- get_snmp_table()
- {
- test_start "Access table $2 by SNMPv$1..."
-- CAPTURE "snmpgetnext -Of -v $1 -c test $myport $2"
-- CHECKFILE '' "\.$2\."
-- if [ "$snmp_last_test_result" = 0 ] ; then
-- test_finish FAIL
-+ check_skip_arp_tests
-+ if check_skip_arp_tests "$2" ; then
-+ test_finish SKIPPED
- else
-- test_finish PASS
-+ CAPTURE "snmpgetnext -Of -v $1 -c test $myport $2"
-+ CHECKFILE '' "\.$2\."
-+ if [ "$snmp_last_test_result" = 0 ] ; then
-+ test_finish FAIL
-+ else
-+ test_finish PASS
-+ fi
- fi
-
- }
-
- get_snmpv3_table()
- {
-- test_start "Access table $2 by SNMPv3..."
-- CAPTURE "snmpgetnext -Of -v 3 -u testrwuser $TEST_AUTHPRIV_PARMS $myport $2"
-- CHECKFILE '' "\.$2\."
-- if [ "$snmp_last_test_result" = 0 ] ; then
-- test_finish FAIL
-+ test_start "Access table $2 by SNMPv3..."
-+ if check_skip_arp_tests "$2" ; then
-+ test_finish SKIPPED
- else
-- test_finish PASS
-+ CAPTURE "snmpgetnext -Of -v 3 -u testrwuser $TEST_AUTHPRIV_PARMS $myport $2"
-+ CHECKFILE '' "\.$2\."
-+ if [ "$snmp_last_test_result" = 0 ] ; then
-+ test_finish FAIL
-+ else
-+ test_finish PASS
-+ fi
- fi
-
- }
-+
---- testing/rfc1213/test_fun
-+++ testing/rfc1213/test_fun
-@@ -51,6 +51,9 @@
- if [ x$1 == x"PASS" ];then
- pass_num=`expr $pass_num + 1`
- pass_info "PASS\n"
-+ elif [ x$1 == x"SKIPPED" ];then
-+ pass_num=`expr $pass_num + 1`
-+ pass_info "SKIPPED\n"
- else
- fail_num=`expr $fail_num + 1`
- fail_info "FAIL\n"
-@@ -66,3 +69,4 @@
- fi
- }
-
-+
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1-64bit.diff
^
|
@@ -1,292 +0,0 @@
-Submitted to SF 2005-02-06
-
-
-Index: agent/mibgroup/mibII/at.c
-===================================================================
---- agent/mibgroup/mibII/at.c.orig
-+++ agent/mibgroup/mibII/at.c
-@@ -126,9 +126,9 @@
- #ifndef solaris2
- static void ARP_Scan_Init(void);
- #ifdef ARP_SCAN_FOUR_ARGUMENTS
--static int ARP_Scan_Next(u_long *, char *, u_long *, u_short *);
-+static int ARP_Scan_Next(u_int *, char *, u_long *, u_short *);
- #else
--static int ARP_Scan_Next(u_long *, char *, u_long *);
-+static int ARP_Scan_Next(u_int *, char *, u_long *);
- #endif
- #endif
- #endif
-@@ -204,7 +204,8 @@
- oid lowest[16];
- oid current[16];
- static char PhysAddr[6], LowPhysAddr[6];
-- u_long Addr, LowAddr, foundone;
-+ u_int Addr, LowAddr, foundone;
-+ static int addr_ret;
- #ifdef ARP_SCAN_FOUR_ARGUMENTS
- u_short ifIndex, lowIfIndex = 0;
- #endif /* ARP_SCAN_FOUR_ARGUMENTS */
-@@ -314,9 +315,9 @@
- *var_len = sizeof(LowPhysAddr);
- return (u_char *) LowPhysAddr;
- case IPMEDIANETADDRESS: /* also ATNETADDRESS */
-- *var_len = sizeof long_return;
-- long_return = LowAddr;
-- return (u_char *) & long_return;
-+ *var_len = sizeof addr_ret;
-+ addr_ret = LowAddr;
-+ return (u_char *) & addr_ret;
- case IPMEDIATYPE:
- *var_len = sizeof long_return;
- long_return = lowIfType;
-@@ -684,11 +685,11 @@
-
- #ifdef ARP_SCAN_FOUR_ARGUMENTS
- static int
--ARP_Scan_Next(u_long * IPAddr, char *PhysAddr, u_long * ifType,
-+ARP_Scan_Next(u_int * IPAddr, char *PhysAddr, u_long * ifType,
- u_short * ifIndex)
- #else
- static int
--ARP_Scan_Next(u_long * IPAddr, char *PhysAddr, u_long * ifType)
-+ARP_Scan_Next(u_int * IPAddr, char *PhysAddr, u_long * ifType)
- #endif
- {
- #ifndef CAN_USE_SYSCTL
-Index: agent/mibgroup/mibII/ipAddr.c
-===================================================================
---- agent/mibgroup/mibII/ipAddr.c.orig
-+++ agent/mibgroup/mibII/ipAddr.c
-@@ -199,6 +199,7 @@
- static struct in_ifaddr in_ifaddr, lowin_ifaddr;
- #else
- static struct ifnet lowin_ifnet;
-+ static in_addr_t addr_ret;
- #endif
- static struct ifnet ifnet;
- #endif /* hpux11 */
-@@ -293,9 +294,10 @@
- *var_len = sizeof(long_return);
- switch (vp->magic) {
- case IPADADDR:
-+ *var_len = sizeof(addr_ret);
- #ifdef hpux11
-- long_return = lowin_ifaddr.Addr;
-- return (u_char *) & long_return;
-+ addr_ret = lowin_ifaddr.Addr;
-+ return (u_char *) & addr_ret;
- #elif defined(linux) || defined(sunV3)
- return (u_char *) & ((struct sockaddr_in *) &lowin_ifnet.if_addr)->
- sin_addr.s_addr;
-@@ -307,15 +309,16 @@
- long_return = lowinterface;
- return (u_char *) & long_return;
- case IPADNETMASK:
-+ *var_len = sizeof(addr_ret);
- #ifdef hpux11
-- long_return = lowin_ifaddr.NetMask;
-- return (u_char *) & long_return;
-+ addr_ret = lowin_ifaddr.NetMask;
-+ return (u_char *) & addr_ret;
- #elif defined(linux)
- return (u_char *) & ((struct sockaddr_in *) &lowin_ifnet.
- ia_subnetmask)->sin_addr.s_addr;
- #elif !defined(sunV3)
-- long_return = lowin_ifaddr.ia_subnetmask;
-- return (u_char *) & long_return;
-+ addr_ret = lowin_ifaddr.ia_subnetmask;
-+ return (u_char *) & addr_ret;
- #endif
- case IPADBCASTADDR:
- #ifdef hpux11
-Index: agent/mibgroup/mibII/ipCidrRouteTable_access.c
-===================================================================
---- agent/mibgroup/mibII/ipCidrRouteTable_access.c.orig
-+++ agent/mibgroup/mibII/ipCidrRouteTable_access.c
-@@ -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 *
-Index: agent/mibgroup/mibII/var_route.c
-===================================================================
---- agent/mibgroup/mibII/var_route.c.orig
-+++ agent/mibgroup/mibII/var_route.c
-@@ -426,6 +426,7 @@
- static oid saveName[MAX_OID_LEN], Current[MAX_OID_LEN];
- u_char *cp;
- oid *op;
-+ static in_addr_t addr_ret;
- #if NEED_KLGETSA
- struct sockaddr_in *sa;
- #endif
-@@ -530,12 +531,13 @@
-
- switch (vp->magic) {
- case IPROUTEDEST:
-+ *var_len = sizeof(addr_ret);
- #if NEED_KLGETSA
- sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_dst);
- return (u_char *) & (sa->sin_addr.s_addr);
- #elif defined(hpux11)
-- long_return = rt[RtIndex].Dest;
-- return (u_char *) & long_return;
-+ addr_ret = rt[RtIndex].Dest;
-+ return (u_char *) & addr_ret;
- #else
- return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]->
- rt_dst)->sin_addr.s_addr;
-@@ -588,12 +590,13 @@
- long_return = -1;
- return (u_char *) & long_return;
- case IPROUTENEXTHOP:
-+ *var_len = sizeof(addr_ret);
- #if NEED_KLGETSA
- sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_gateway);
- return (u_char *) & (sa->sin_addr.s_addr);
- #elif defined(hpux11)
-- long_return = rt[RtIndex].NextHop;
-- return (u_char *) & long_return;
-+ addr_ret = rt[RtIndex].NextHop;
-+ return (u_char *) & addr_ret;
- #else
- return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]->
- rt_gateway)->sin_addr.s_addr;
-@@ -630,6 +633,7 @@
- long_return = 0;
- return (u_char *) & long_return;
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1-audit.diff
^
|
@@ -1,238 +0,0 @@
-Index: agent/mibgroup/examples/ucdDemoPublic.c
-===================================================================
---- agent/mibgroup/examples/ucdDemoPublic.c.orig
-+++ agent/mibgroup/examples/ucdDemoPublic.c
-@@ -219,7 +219,11 @@
- }
- if (action == COMMIT) {
- if (var_val_len != 0) {
-- strcpy(publicString, var_val);
-+ strncpy(publicString, var_val, sizeof(publicString)-1);
-+ /* XXX thomas: just some sanity checks */
-+ if(strlen(var_val) > sizeof(publicString)-1 || strlen(var_val) != var_val_len)
-+ publicString[sizeof(publicString)-1] = '\0';
-+ else
- publicString[var_val_len] = '\0';
- } else
- publicString[0] = '\0';
-Index: agent/mibgroup/mibII/system_mib.c
-===================================================================
---- agent/mibgroup/mibII/system_mib.c.orig
-+++ agent/mibgroup/mibII/system_mib.c
-@@ -126,7 +126,7 @@
- char tmpbuf[1024];
-
- if (strlen(cptr) >= sizeof(sysLocation)) {
-- snprintf(tmpbuf, 1024,
-+ snprintf(tmpbuf, sizeof(tmpbuf),
- "syslocation token too long (must be < %lu):\n\t%s",
- (unsigned long)sizeof(sysLocation), cptr);
- config_perror(tmpbuf);
-@@ -173,7 +173,7 @@
- char tmpbuf[1024];
-
- if (strlen(cptr) >= sizeof(sysContact)) {
-- snprintf(tmpbuf, 1024,
-+ snprintf(tmpbuf, sizeof(tmpbuf),
- "syscontact token too long (must be < %lu):\n\t%s",
- (unsigned long)sizeof(sysContact), cptr);
- config_perror(tmpbuf);
-@@ -220,7 +220,7 @@
- char tmpbuf[1024];
-
- if (strlen(cptr) >= sizeof(sysName)) {
-- snprintf(tmpbuf, 1024,
-+ snprintf(tmpbuf, sizeof(tmpbuf),
- "sysname token too long (must be < %lu):\n\t%s",
- (unsigned long)sizeof(sysName), cptr);
- config_perror(tmpbuf);
-Index: agent/mibgroup/mibII/var_route.c
-===================================================================
---- agent/mibgroup/mibII/var_route.c.orig
-+++ agent/mibgroup/mibII/var_route.c
-@@ -1328,7 +1328,7 @@
- /*
- * Sort it!
- */
-- qsort((char *) rthead, rtsize, sizeof(rthead[0]), qsort_compare);
-+ qsort((char *) rthead, rtsize, sizeof(rthead[0]), (int (*) (const void*, const void*)) qsort_compare);
- }
- #endif
- #endif
-Index: agent/mibgroup/util_funcs.c
-===================================================================
---- agent/mibgroup/util_funcs.c.orig
-+++ agent/mibgroup/util_funcs.c
-@@ -139,6 +139,10 @@
- }
- #endif
- if (fd >= 0) {
-+ if(fchmod(fd, 0600) != 0) {
-+ close(fd);
-+ return NULL;
-+ }
- close(fd);
- DEBUGMSGTL(("make_tempfile", "temp file created: %s\n", name));
- return name;
-Index: agent/auto_nlist.c
-===================================================================
---- agent/auto_nlist.c.orig
-+++ agent/auto_nlist.c
-@@ -64,6 +64,7 @@
- it->nl[0].n_name = (char *) malloc(strlen(string) + 2);
- #ifdef aix4
- strcpy(it->nl[0].n_name, string);
-+ it->nl[0].n_name[strlen(string)+1] = '\0';
- #else
- sprintf(it->nl[0].n_name, "_%s", string);
- #endif
-@@ -72,6 +73,7 @@
- #ifndef aix4
- if (it->nl[0].n_type == 0) {
- strcpy(it->nl[0].n_name, string);
-+ it->nl[0].n_name[strlen(string)+1] = '\0';
- init_nlist(it->nl);
- }
- #endif
-Index: agent/snmp_agent.c
-===================================================================
---- agent/snmp_agent.c.orig
-+++ agent/snmp_agent.c
-@@ -1169,9 +1169,9 @@
- * No, so just specify the default port.
- */
- if (netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_FLAGS) & SNMP_FLAGS_STREAM_SOCKET) {
-- sprintf(buf, "tcp:%d", SNMP_PORT);
-+ snprintf(buf, sizeof(buf), "tcp:%d", SNMP_PORT);
- } else {
-- sprintf(buf, "udp:%d", SNMP_PORT);
-+ snprintf(buf, sizeof(buf), "udp:%d", SNMP_PORT);
- }
- }
-
-Index: apps/snmptest.c
-===================================================================
---- apps/snmptest.c.orig
-+++ apps/snmptest.c
-@@ -456,6 +456,7 @@
- goto getValue;
- }
- memcpy(vp->val.string, buf, strlen(buf) - 1);
-+ vp->val.string[sizeof(vp->val.string)-1] = 0;
- vp->val_len = strlen(buf) - 1;
- } else if (ch == 'x') {
- size_t buf_len = 256;
-Index: apps/snmptrapd_handlers.c
-===================================================================
---- apps/snmptrapd_handlers.c.orig
-+++ apps/snmptrapd_handlers.c
-@@ -24,6 +24,9 @@
- #include <sys/wait.h>
- #endif
-
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+
- #include <net-snmp/config_api.h>
- #include <net-snmp/output_api.h>
- #include <net-snmp/mib_api.h>
-@@ -788,10 +791,11 @@
- #else
- char command_buf[128];
- char file_buf[L_tmpnam];
-+ int win_fd;
-
- tmpnam(file_buf);
-- file = fopen(file_buf, "w");
-- if (!file) {
-+ win_fd = open(file_buf, O_RDWR | O_CREAT | O_EXCL, 0600);
-+ if (win_fd < 0 || (file = fdopen(win_fd, "w")) == NULL)
- fprintf(stderr, "fopen: %s: %s\n", file_buf, strerror(errno));
- } else {
- send_handler_data(file, host, pdu, transport);
-Index: snmplib/parse.c
-===================================================================
---- snmplib/parse.c.orig
-+++ snmplib/parse.c
-@@ -4161,7 +4161,7 @@
- parse(FILE * fp, struct node *root)
- {
- char token[MAXTOKEN];
-- char name[MAXTOKEN];
-+ char name[MAXTOKEN+1];
- int type = LABEL;
- int lasttype = LABEL;
-
-@@ -4253,7 +4253,8 @@
- case ENDOFFILE:
- continue;
- default:
-- strcpy(name, token);
-+ strncpy(name, token, sizeof(name));
-+ name[sizeof(name)-1] = '\0';
- type = get_token(fp, token, MAXTOKEN);
- nnp = NULL;
- if (type == MACRO) {
-@@ -4270,7 +4271,8 @@
- print_error(name, "is a reserved word", lasttype);
- continue; /* see if we can parse the rest of the file */
- }
-- strcpy(name, token);
-+ strncpy(name, token, sizeof(name));
-+ name[sizeof(name)-1] = '\0';
- type = get_token(fp, token, MAXTOKEN);
- nnp = NULL;
-
-Index: snmplib/tools.c
-===================================================================
---- snmplib/tools.c.orig
-+++ snmplib/tools.c
-@@ -695,7 +695,7 @@
- /*
- * s += snprintf(s, remaining_len+3, "\"%s\"", esp);
- */
-- s += sprintf(s, "\"%s\"", esp);
-+ s += sprintf(s, "\"%.*s\"", sizeof(buf)-strlen(buf)-3, esp);
- goto dump_snmpEngineID_quit;
- break;
- /*NOTREACHED*/ case 5: /* Octets. */
-Index: testing/TESTCONF.sh
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1-smux-trap.diff
^
|
@@ -1,15 +0,0 @@
---- agent/mibgroup/smux/smux.c.orig 2005-09-27 11:45:14.000000000 -0500
-+++ agent/mibgroup/smux/smux.c 2006-02-10 13:46:31.000000000 -0600
-@@ -1915,10 +1915,10 @@
- snmptrap_ptr = snmptrap_ptr->next_variable;
- }
-
-- snmp_set_var_objid(snmptrap_ptr, var_name, var_name_len);
-- snmp_set_var_value(snmptrap_ptr, (char *) var_val, var_val_len);
- snmptrap_ptr->type = vartype;
- snmptrap_ptr->next_variable = NULL;
-+ snmp_set_var_objid(snmptrap_ptr, var_name, var_name_len);
-+ snmp_set_var_value(snmptrap_ptr, (char *) var_val, var_val_len);
-
- }
-
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_CVE-2007-5846.patch
^
|
@@ -1,124 +0,0 @@
-=== man/snmpd.conf.5.def
-==================================================================
-Index: man/snmpd.conf.5.def
-===================================================================
---- man/snmpd.conf.5.def.orig 2007-11-16 16:09:19.000000000 +0100
-+++ man/snmpd.conf.5.def 2007-11-16 16:09:22.272048114 +0100
-@@ -71,6 +71,28 @@ starting with '#' (#UID).
- .IP "leave_pidfile yes"
- instructs the agent to not remove its pid file on shutdown. Equivalent to
- specifying "-U" on the command line.
-+.IP "maxGetbulkRepeats NUM"
-+Sets the maximum number of responses allowed for a single variable in
-+a getbulk request. Set to 0 to enable the default and set it to -1 to
-+enable unlimited. Because memory is allocated ahead of time, sitting
-+this to unlimited is not considered safe if your user population can
-+not be trusted. A repeat number greater than this will be truncated
-+to this value.
-+.IP
-+This is set by default to -1.
-+.IP "maxGetbulkResponses NUM"
-+Sets the maximum number of responses allowed for a getbulk request.
-+This is set by default to 100. Set to 0 to enable the default and set
-+it to -1 to enable unlimited. Because memory is allocated ahead of
-+time, sitting this to unlimited is not considered safe if your user
-+population can not be trusted.
-+.IP
-+In general, the total number of responses will not be allowed to
-+exceed the maxGetbulkResponses number and the total number returned
-+will be an integer multiple of the number of variables requested times
-+the calculated number of repeats allow to fit below this number.
-+.IP
-+Also not that processing of maxGetbulkRepeats is handled first.
- .SS SNMPv3 Configuration
- SNMPv3 requires an SNMP agent to define a unique "engine ID"
- in order to respond to SNMPv3 requests.
-Index: include/net-snmp/agent/ds_agent.h
-===================================================================
---- include/net-snmp/agent/ds_agent.h.orig 2007-11-16 16:09:19.000000000 +0100
-+++ include/net-snmp/agent/ds_agent.h 2007-11-16 16:09:22.288049071 +0100
-@@ -52,5 +52,7 @@
- #define NETSNMP_DS_AGENT_CACHE_TIMEOUT 10 /* default cache timeout */
- #define NETSNMP_DS_AGENT_INTERNAL_VERSION 11 /* used by internal queries */
- #define NETSNMP_DS_AGENT_INTERNAL_SECLEVEL 12 /* used by internal queries */
-+#define NETSNMP_DS_AGENT_MAX_GETBULKREPEATS 13 /* max getbulk repeats */
-+#define NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES 14 /* max getbulk respones */
-
- #endif
-Index: agent/agent_read_config.c
-===================================================================
---- agent/agent_read_config.c.orig 2007-11-16 16:09:19.000000000 +0100
-+++ agent/agent_read_config.c 2007-11-16 16:10:06.014664579 +0100
-@@ -258,7 +258,13 @@ init_agent_read_config(const char *app)
- netsnmp_ds_register_config(ASN_BOOLEAN, app, "dontLogTCPWrappersConnects",
- NETSNMP_DS_APPLICATION_ID,
- NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS);
-- netsnmp_init_handler_conf();
-+ netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkRepeats",
-+ NETSNMP_DS_APPLICATION_ID,
-+ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS);
-+ netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkResponses",
-+ NETSNMP_DS_APPLICATION_ID,
-+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES);
-+ netsnmp_init_handler_conf();
-
- #include "agent_module_dot_conf.h"
- #include "mib_module_dot_conf.h"
-Index: agent/snmp_agent.c
-===================================================================
---- agent/snmp_agent.c.orig 2007-11-16 16:09:19.000000000 +0100
-+++ agent/snmp_agent.c 2007-11-16 16:09:22.328051464 +0100
-@@ -2141,7 +2141,6 @@ netsnmp_create_subtree_cache(netsnmp_age
- * getbulk prep
- */
- int count = count_varbinds(asp->pdu->variables);
--
- if (asp->pdu->errstat < 0) {
- asp->pdu->errstat = 0;
- }
-@@ -2158,13 +2157,44 @@ netsnmp_create_subtree_cache(netsnmp_age
- r = 0;
- asp->bulkcache = NULL;
- } else {
-+ int numresponses;
-+ int maxbulk =
-+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
-+ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS);
-+ int maxresponses =
-+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
-+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES);
-+
-+ if (maxresponses == 0)
-+ maxresponses = 100; /* more than reasonable default */
-+
-+ if (maxbulk == 0)
-+ maxbulk = -1;
-+
-+ /* limit getbulk number of repeats to a configured size */
-+ if (asp->pdu->errindex > maxbulk && maxbulk != -1) {
-+ asp->pdu->errindex = maxbulk;
-+ }
-+
-+ numresponses = asp->pdu->errindex * r;
-+
-+ /* limit getbulk number of getbulk responses to a configured size */
-+ if (maxresponses != -1 && numresponses > maxresponses) {
-+ /* attempt to truncate this */
-+ asp->pdu->errindex = maxresponses/r;
-+ numresponses = asp->pdu->errindex * r;
-+ DEBUGMSGTL(("snmp_agent", "truncating number of getbulk repeats to %d\n", asp->pdu->errindex));
-+ }
-+
- asp->bulkcache =
-- (netsnmp_variable_list **) malloc(asp->pdu->errindex * r *
-+ (netsnmp_variable_list **) malloc(numresponses *
- sizeof(struct
- varbind_list *));
- }
- DEBUGMSGTL(("snmp_agent", "GETBULK N = %d, M = %d, R = %d\n",
- n, asp->pdu->errindex, r));
-+ fprintf(stderr, "GETBULK N = %d, M = %d, R = %d\n",
-+ n, asp->pdu->errindex, r);
- }
-
- /*
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_agentx_socket_path_doc.patch
^
|
@@ -1,39 +0,0 @@
-Index: man/snmpd.conf.5.def
-===================================================================
---- man/snmpd.conf.5.def.orig
-+++ man/snmpd.conf.5.def
-@@ -1248,7 +1248,7 @@
- .IP "agentXSocket [<transport-specifier>:]<transport-address>[,...]"
- defines the address the master agent listens at, or the subagent
- should connect to.
--The default is the Unix Domain socket \fC/var/agentx/master\fR.
-+The default is the Unix Domain socket \fC/var/run/agentx/master\fR.
- Another common alternative is \fCtcp:localhost:705\fR.
- See the section
- .B LISTENING ADDRESSES
-Index: man/snmpd.8.def
-===================================================================
---- man/snmpd.8.def.orig
-+++ man/snmpd.8.def
-@@ -133,7 +133,7 @@
- .TP
- .B -x \fIADDRESS
- Listens for AgentX connections on the specified address
--rather than the default '/var/agentx/master'.
-+rather than the default '/var/run/agentx/master'.
- The address can either be a Unix domain socket path,
- or the address of a network interface. The format is the same as the
- format of listening addresses described below.
-Index: man/snmptrapd.8.def
-===================================================================
---- man/snmptrapd.8.def.orig
-+++ man/snmptrapd.8.def
-@@ -140,7 +140,7 @@
- .TP
- .B -x \fIADDRESS
- Connect to the AgentX master agent on the specified address,
--rather than the default '/var/agentx/master'.
-+rather than the default '/var/run/agentx/master'.
- See \fIsnmpd(8)\fR for details of the format of such addresses.
- .TP
- .BI -- "name"="value"
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_deprecated_sysctl_retrans_time.patch
^
|
@@ -1,91 +0,0 @@
-Index: agent/mibgroup/if-mib/data_access/interface_linux.c
-===================================================================
---- agent/mibgroup/if-mib/data_access/interface_linux.c.orig
-+++ agent/mibgroup/if-mib/data_access/interface_linux.c
-@@ -22,6 +22,8 @@
- #include "interface_ioctl.h"
-
- #include <sys/types.h>
-+#include <sys/stat.h>
-+#include <unistd.h>
-
- #ifdef HAVE_LINUX_ETHTOOL_H
- #include <sys/types.h>
-@@ -40,6 +42,10 @@ unsigned int
- netsnmp_linux_interface_get_if_speed_mii(int fd, const char *name);
- #endif
-
-+#define PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS "/proc/sys/net/ipv%d/neigh/%s/retrans_time_ms"
-+#define PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME "/proc/sys/net/ipv%d/neigh/%s/retrans_time"
-+static char *proc_sys_retrans_time;
-+static unsigned short retrans_time_factor = 0;
-
- void
- netsnmp_arch_interface_init(void)
-@@ -47,6 +53,20 @@ netsnmp_arch_interface_init(void)
- /*
- * nothing to do
- */
-+ char proc_path[64+IF_NAMESIZE];
-+ char proc_path2[64+IF_NAMESIZE];
-+ struct stat st;
-+
-+ snprintf(proc_path, sizeof(proc_path), PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS, 6, "default");
-+ snprintf(proc_path2, sizeof(proc_path2), PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS, 4, "default");
-+
-+ if ((stat(proc_path, &st) == 0) || (stat(proc_path2, &st) == 0)) {
-+ proc_sys_retrans_time = PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS;
-+ }
-+ else {
-+ proc_sys_retrans_time = PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME;
-+ retrans_time_factor = 10;
-+ }
- }
-
- /*
-@@ -161,7 +181,7 @@ _arch_interface_flags_v4_get(netsnmp_int
- /*
- * get the retransmit time
- */
-- snprintf(line,sizeof(line),"/proc/sys/net/ipv4/neigh/%s/retrans_time",
-+ snprintf(line,sizeof(line),proc_sys_retrans_time, 4,
- entry->name);
- if (!(fin = fopen(line, "r"))) {
- DEBUGMSGTL(("access:interface",
-@@ -169,7 +189,12 @@ _arch_interface_flags_v4_get(netsnmp_int
- }
- else {
- if (fgets(line, sizeof(line), fin)) {
-- entry->retransmit_v4 = atoi(line) * 100;
-+ if (retrans_time_factor) {
-+ entry->retransmit_v4 = atoi(line) * retrans_time_factor;
-+ }
-+ else {
-+ entry->retransmit_v4 = atoi(line);
-+ };
- entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V4_RETRANSMIT;
- }
- fclose(fin);
-@@ -191,7 +216,7 @@ _arch_interface_flags_v6_get(netsnmp_int
- /*
- * get the retransmit time
- */
-- snprintf(line,sizeof(line),"/proc/sys/net/ipv6/neigh/%s/retrans_time",
-+ snprintf(line,sizeof(line),proc_sys_retrans_time, 6,
- entry->name);
- if (!(fin = fopen(line, "r"))) {
- DEBUGMSGTL(("access:interface",
-@@ -199,7 +224,12 @@ _arch_interface_flags_v6_get(netsnmp_int
- }
- else {
- if (fgets(line, sizeof(line), fin)) {
-- entry->retransmit_v6 = atoi(line);
-+ if (retrans_time_factor) {
-+ entry->retransmit_v6 = atoi(line) * retrans_time_factor;
-+ }
-+ else {
-+ entry->retransmit_v6 = atoi(line);
-+ };
- entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT;
- }
- fclose(fin);
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_disman_mib_crash.patch
^
|
@@ -1,13 +0,0 @@
-Index: include/net-snmp/types.h
-===================================================================
---- include/net-snmp/types.h.orig
-+++ include/net-snmp/types.h
-@@ -144,7 +144,7 @@
- */
-
- typedef struct netsnmp_index_s {
-- int len;
-+ size_t len;
- oid *oids;
- } netsnmp_index;
-
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_empty_smux_peer_password.patch
^
|
@@ -1,81 +0,0 @@
-----------------------------------------------------------------------
-r15943 (orig r15942): dts12 | 2007-03-12 20:47:26 +0100
-Changed paths:
- M /upstream/branches/V5-2-patches/net-snmp/agent/mibgroup/smux/smux.c
- M /upstream/branches/V5-3-patches/net-snmp/agent/mibgroup/smux/smux.c
- M /upstream/branches/V5-4-patches/net-snmp/agent/mibgroup/smux/smux.c
- M /upstream/trunk/net-snmp/agent/mibgroup/smux/smux.c
-
-CHANGES: snmpd: PATCHES: 1659623: Handle SMUX peers with an empty password.
-
-----------------------------------------------------------------------
-=== agent/mibgroup/smux/smux.c
-==================================================================
---- agent/mibgroup/smux/smux.c (revision 15942)
-+++ agent/mibgroup/smux/smux.c (revision 15943)
-@@ -150,42 +150,40 @@
- config_perror("Too many smuxpeers");
- return;
- }
-- aptr->sa_active_fd = -1;
-- if (!cptr) {
-- /*
-- * null passwords OK
-- */
-- Auths[nauths++] = aptr;
-- DEBUGMSGTL(("smux_conf", "null password\n"));
-- return;
-- }
-
- /*
- * oid
- */
-- password_cptr = strchr(cptr, ' ');
-- cptr_len = strlen(cptr);
-- if (password_cptr)
-- *password_cptr = 0x0;
--
-+ aptr->sa_active_fd = -1;
- aptr->sa_oid_len = MAX_OID_LEN;
- read_objid( cptr, aptr->sa_oid, &aptr->sa_oid_len );
--
- DEBUGMSGTL(("smux_conf", "parsing registration for: %s\n", cptr));
-
-- if ((&password_cptr - &cptr + 1) < cptr_len) {
-- cptr = ++password_cptr;
-- DEBUGMSGTL(("smux_conf", "password is: %s\n",
-- cptr ? cptr : "NULL"));
-- }
-+ password_cptr = strchr(cptr, ' ');
-+ cptr_len = strlen(cptr);
-
-- /*
-- * password
-- */
-- if (cptr)
-- strcpy(aptr->sa_passwd, cptr);
-+ if (password_cptr != NULL) { /* Do we have a password or not? */
-+ *password_cptr = 0x0;
-+ if ((password_cptr - cptr + 1) < cptr_len) {
-+ cptr = ++password_cptr;
-+ DEBUGMSGTL(("smux_conf", "password is: %s\n",
-+ cptr ? cptr : "NULL"));
-+ }
-
-+ /*
-+ * password
-+ */
-+ if (cptr)
-+ strcpy(aptr->sa_passwd, cptr);
-+ } else {
-+ /*
-+ * null passwords OK
-+ */
-+ DEBUGMSGTL(("smux_conf", "null password\n"));
-+ }
-+
- Auths[nauths++] = aptr;
-+ return;
- }
-
- void
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_ethtool.patch
^
|
@@ -1,42 +0,0 @@
-Index: configure.in
-===================================================================
---- configure.in.orig
-+++ configure.in
-@@ -2639,10 +2639,11 @@
- # linux ethtool
- AC_CHECK_HEADERS(linux/ethtool.h,,,
- [[
--#include <linux/types.h>
--#if HAVE_PCI_PCI_H
--#include <pci/pci.h>
--#endif
-+#include <sys/types.h>
-+typedef unsigned long long u64; /* hack, so we may include kernel's ethtool.h */
-+typedef __uint32_t u32; /* ditto */
-+typedef __uint16_t u16; /* ditto */
-+typedef __uint8_t u8; /* ditto */
- ]])
- # BSDi3 headers
- AC_CHECK_HEADERS(sys/stat.h sys/vnode.h)
-Index: agent/mibgroup/if-mib/data_access/interface_linux.c
-===================================================================
---- agent/mibgroup/if-mib/data_access/interface_linux.c.orig
-+++ agent/mibgroup/if-mib/data_access/interface_linux.c
-@@ -24,12 +24,11 @@
- #include <sys/types.h>
-
- #ifdef HAVE_LINUX_ETHTOOL_H
--# ifdef HAVE_ASM_TYPES_H
--# include <asm/types.h>
--# endif /* HAVE_ASM_TYPES_H */
--# ifdef HAVE_PCI_PCI_H
--# include <pci/pci.h> /* for u32 typedef in linux/ethtool */
--# endif /* HAVE_PCI_PCI_H */
-+#include <sys/types.h>
-+typedef unsigned long long u64; /* hack, so we may include kernel's ethtool.h */
-+typedef __uint32_t u32; /* ditto */
-+typedef __uint16_t u16; /* ditto */
-+typedef __uint8_t u8; /* ditto */
- #include <linux/ethtool.h>
- #endif /* HAVE_LINUX_ETHTOOL_H */
- #include <linux/sockios.h>
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_large_log_message_crash.patch
^
|
@@ -1,71 +0,0 @@
-Index: snmplib/snmp_logging.c
-===================================================================
---- snmplib/snmp_logging.c.orig 2007-02-07 19:11:50.363146352 +0100
-+++ snmplib/snmp_logging.c 2007-02-07 19:11:53.831347751 +0100
-@@ -1161,19 +1161,32 @@ snmp_vlog(int priority, const char *form
- char buffer[LOGLENGTH];
- int length;
- char *dynamic;
-+ va_list aq;
-
-+ va_copy(aq, ap);
- length = vsnprintf(buffer, LOGLENGTH, format, ap);
-+ va_end(ap);
-
-- if (length == 0)
-+ if (length == 0) {
-+#ifdef NEED_VA_END_AFTER_VA_COPY
-+ va_end(aq);
-+#endif
- return (0); /* Empty string */
-+ }
-
- if (length == -1) {
- snmp_log_string(LOG_ERR, "Could not format log-string\n");
-+#ifdef NEED_VA_END_AFTER_VA_COPY
-+ va_end(aq);
-+#endif
- return (-1);
- }
-
- if (length < LOGLENGTH) {
- snmp_log_string(priority, buffer);
-+#ifdef NEED_VA_END_AFTER_VA_COPY
-+ va_end(aq);
-+#endif
- return (0);
- }
-
-@@ -1182,12 +1195,16 @@ snmp_vlog(int priority, const char *form
- snmp_log_string(LOG_ERR,
- "Could not allocate memory for log-message\n");
- snmp_log_string(priority, buffer);
-+#ifdef NEED_VA_END_AFTER_VA_COPY
-+ va_end(aq);
-+#endif
- return (-2);
- }
-
-- vsnprintf(dynamic, length + 1, format, ap);
-+ vsnprintf(dynamic, length + 1, format, aq);
- snmp_log_string(priority, dynamic);
- free(dynamic);
-+ va_end(aq);
- return 0;
- }
-
-Index: agent/mibgroup/if-mib/ifTable/ifTable_data_access.c
-===================================================================
---- agent/mibgroup/if-mib/ifTable/ifTable_data_access.c.orig 2007-02-05 15:49:42.496318901 +0100
-+++ agent/mibgroup/if-mib/ifTable/ifTable_data_access.c 2007-02-07 19:11:54.023358902 +0100
-@@ -197,8 +197,8 @@ _check_interface_entry_for_updates(ifTab
- DEBUGMSGTL(("ifTable:access", "updating existing entry\n"));
-
- #ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
-- netsnmp_assert(strcmp(rowreq_ctx->data.ifName,
-- ifentry->name) == 0);
-+ int strcmp_rc = strcmp(rowreq_ctx->data.ifName, ifentry->name);
-+ netsnmp_assert(strcmp_rc == 0);
- #endif
- /*
- * if the interface was missing, but came back, clear the
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_missing_ifNumber.patch
^
|
@@ -1,83 +0,0 @@
-https://sourceforge.net/tracker/?func=detail&atid=112694&aid=1399369&group_id=12694
-
-Index: agent/mibgroup/if-mib/ifTable/ifTable.c
-===================================================================
---- agent/mibgroup/if-mib/ifTable/ifTable.c.orig
-+++ agent/mibgroup/if-mib/ifTable/ifTable.c
-@@ -44,6 +44,12 @@ ifTable_registration ifTable_user_contex
- void initialize_table_ifTable(void);
- void shutdown_table_ifTable(void);
-
-+static int
-+_if_number_handler(netsnmp_mib_handler *handler,
-+ netsnmp_handler_registration *reginfo,
-+ netsnmp_agent_request_info *reqinfo,
-+ netsnmp_request_info *requests);
-+
-
- /**
- * Initializes the ifTable module
-@@ -135,6 +141,24 @@ initialize_table_ifTable(void)
- * call interface initialization code
- */
- _ifTable_initialize_interface(user_context, flags);
-+
-+ /*
-+ * register scalar for ifNumber
-+ */
-+ {
-+ oid reg_oid[] =
-+ { IFTABLE_NUMBER };
-+ netsnmp_handler_registration *myreg;
-+
-+ myreg =
-+ netsnmp_create_handler_registration("if number",
-+ _if_number_handler,
-+ ®_oid,
-+ OID_LENGTH(reg_oid),
-+ HANDLER_CAN_RONLY);
-+ netsnmp_register_instance(myreg);
-+ }
-+
- } /* initialize_table_ifTable */
-
- /**
-@@ -2307,5 +2331,26 @@ ifTable_check_dependencies(ifTable_rowre
- return rc;
- } /* ifTable_check_dependencies */
-
-+
-+static int
-+_if_number_handler(netsnmp_mib_handler *handler,
-+ netsnmp_handler_registration *reginfo,
-+ netsnmp_agent_request_info *reqinfo,
-+ netsnmp_request_info *requests)
-+{
-+ if (MODE_GET == reqinfo->mode) {
-+ int val = ifTable_container_size();
-+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
-+ (u_char *) &val, sizeof(val));
-+ } else
-+ netsnmp_assert("bad mode in RO handler");
-+
-+ if (handler->next && handler->next->access_method)
-+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
-+ requests);
-+
-+ return SNMP_ERR_NOERROR;
-+}
-+
- /** @} */
- /** @{ */
-Index: agent/mibgroup/if-mib/ifTable/ifTable_constants.h
-===================================================================
---- agent/mibgroup/if-mib/ifTable/ifTable_constants.h.orig
-+++ agent/mibgroup/if-mib/ifTable/ifTable_constants.h
-@@ -15,6 +15,7 @@ extern "C" {
- * scalars
- */
- #define IFTABLE_LAST_CHANGE 1,3,6,1,2,1,31,1,5
-+#define IFTABLE_NUMBER 1,3,6,1,2,1,2,1,0
-
-
- /*
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_netsnmp_register_mib_crash.patch
^
|
@@ -1,13 +0,0 @@
-Index: agent/agent_registry.c
-===================================================================
---- agent/agent_registry.c.orig
-+++ agent/agent_registry.c
-@@ -1451,7 +1451,7 @@
- lookup_cache *lookup_cache = NULL;
- netsnmp_subtree *myptr = NULL, *previous = NULL;
- int cmp = 1;
-- int ll_off = 0;
-+ size_t ll_off = 0;
-
- if (subtree) {
- myptr = subtree;
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_perl_ld_run_path.patch
^
|
@@ -1,13 +0,0 @@
-Index: Makefile.in
-===================================================================
---- Makefile.in.orig
-+++ Makefile.in
-@@ -154,7 +154,7 @@ OTHERCLEANTODOS=perlclean
- # perl specific build rules
- #
- perlmodules: perlmakefiles
-- @(cd perl ; $(MAKE)) ; \
-+ @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{archlibexp}/CORE);'`") ; \
- if test $$? != 0 ; then \
- exit 1 ; \
- fi
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_sighup_vacm.patch
^
|
@@ -1,26 +0,0 @@
-https://sourceforge.net/tracker/index.php?func=detail&aid=1473289&group_id=12694&atid=456380
-
-Index: agent/agent_read_config.c
-===================================================================
---- agent/agent_read_config.c.orig
-+++ agent/agent_read_config.c
-@@ -273,6 +273,7 @@ update_config(void)
- snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
- SNMPD_CALLBACK_PRE_UPDATE_CONFIG, NULL);
- free_config();
-+ vacm_standard_views(0,0,NULL,NULL);
- read_configs();
- }
-
-Index: apps/snmptrapd.c
-===================================================================
---- apps/snmptrapd.c.orig
-+++ apps/snmptrapd.c
-@@ -1304,6 +1304,7 @@ void
- trapd_update_config(void)
- {
- free_config();
-+ vacm_standard_views(0,0,NULL,NULL);
- read_configs();
- }
-
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_tcpwrapper_log_severity.patch
^
|
@@ -1,90 +0,0 @@
-Index: agent/snmp_agent.c
-===================================================================
---- agent/snmp_agent.c.orig
-+++ agent/snmp_agent.c
-@@ -791,9 +791,20 @@
- char *addr_string = NULL;
- #ifdef USE_LIBWRAP
- char *tcpudpaddr, *name;
-+ short not_log_connection;
-
-- name = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
-+ name = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
- NETSNMP_DS_LIB_APPTYPE);
-+
-+ /* not_log_connection will be 1 if we should skip the messages */
-+ not_log_connection = netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
-+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS);
-+
-+ /*
-+ * handle the error case
-+ * default to logging the messages
-+ */
-+ if (not_log_connection == SNMPERR_GENERR) not_log_connection = 0;
- #endif
-
- /*
-@@ -824,7 +835,9 @@
- *xp = '\0';
-
- if (hosts_ctl(name, STRING_UNKNOWN, sbuf, STRING_UNKNOWN)) {
-- snmp_log(allow_severity, "Connection from %s\n", addr_string);
-+ if (!not_log_connection) {
-+ snmp_log(allow_severity, "Connection from %s\n", addr_string);
-+ }
- } else {
- snmp_log(deny_severity, "Connection from %s REFUSED\n",
- addr_string);
-@@ -839,7 +852,9 @@
- if (0 == strncmp(addr_string, "callback", 8))
- ;
- else if (hosts_ctl(name, STRING_UNKNOWN, STRING_UNKNOWN, STRING_UNKNOWN)){
-- snmp_log(allow_severity, "Connection from <UNKNOWN> (%s)\n", addr_string);
-+ if (!not_log_connection) {
-+ snmp_log(allow_severity, "Connection from <UNKNOWN> (%s)\n", addr_string);
-+ };
- addr_string = strdup("<UNKNOWN>");
- } else {
- snmp_log(deny_severity, "Connection from <UNKNOWN> (%s) REFUSED\n", addr_string);
-Index: agent/agent_read_config.c
-===================================================================
---- agent/agent_read_config.c.orig
-+++ agent/agent_read_config.c
-@@ -255,6 +255,9 @@
- netsnmp_ds_register_config(ASN_BOOLEAN, app, "leave_pidfile",
- NETSNMP_DS_APPLICATION_ID,
- NETSNMP_DS_AGENT_LEAVE_PIDFILE);
-+ netsnmp_ds_register_config(ASN_BOOLEAN, app, "dontLogTCPWrappersConnects",
-+ NETSNMP_DS_APPLICATION_ID,
-+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS);
- netsnmp_init_handler_conf();
-
- #include "agent_module_dot_conf.h"
-Index: include/net-snmp/agent/ds_agent.h
-===================================================================
---- include/net-snmp/agent/ds_agent.h.orig
-+++ include/net-snmp/agent/ds_agent.h
-@@ -18,6 +18,7 @@
- #define NETSNMP_DS_AGENT_NO_CACHING 8 /* 1 = disable netsnmp_cache */
- #define NETSNMP_DS_AGENT_STRICT_DISMAN 9 /* 1 = "correct" object ordering */
- #define NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS 10 /* 1 = disable trap logging */
-+#define NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS 12 /* 1 = disable logging */
- #define NETSNMP_DS_APP_DONT_LOG NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS /* compat */
-
- /* WARNING: The trap receiver uses DS flags and must not conflict with
-Index: man/snmpd.conf.5.def
-===================================================================
---- man/snmpd.conf.5.def.orig
-+++ man/snmpd.conf.5.def
-@@ -1348,6 +1348,11 @@
- this module will convert all getbulk requests to
- getnext requests before the final module receives it.
- .RE
-+.IP "dontLogTCPWrappersConnects"
-+If the \fBsnmpd\fR was compiled with TCP Wrapper support, it
-+logs every connection made to the agent. This setting disables
-+the log messages for accepted connections. Denied connections will
-+still be logged.
- .IP "Figuring out module names"
- To figure out which modules you can inject things into,
- run \fBsnmpwalk\fR on the \fCnsModuleTable\fR which will give
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_testsuite_no_smux.patch
^
|
@@ -1,13 +0,0 @@
-Index: testing/eval_tools.sh
-===================================================================
---- testing/eval_tools.sh.orig
-+++ testing/eval_tools.sh
-@@ -404,7 +404,7 @@
- #------------------------------------ -o-
- STARTAGENT() {
- SNMPDSTARTED=1
-- COMMAND="snmpd $SNMP_FLAGS -r -U -p $SNMP_SNMPD_PID_FILE -Lf $SNMP_SNMPD_LOG_FILE $AGENT_FLAGS"
-+ COMMAND="snmpd $SNMP_FLAGS -I -smux -r -U -p $SNMP_SNMPD_PID_FILE -Lf $SNMP_SNMPD_LOG_FILE $AGENT_FLAGS"
- CFG_FILE=$SNMP_CONFIG_FILE
- LOG_FILE=$SNMP_SNMPD_LOG_FILE
- PORT_SPEC="$SNMP_SNMPD_PORT"
|
[-]
[+]
|
Added |
net-snmp-5.3.0.1_trap-agent-addr_v2.patch
^
|
@@ -0,0 +1,206 @@
+426355: Cannot set source agent address for SNMP traps
+
+Author: Jan Safranek <jsafrane@redhat.com>
+
+Introduce "v1trapaddress" snmpd config option, which defines agent address
+set in SNMPv1 traps, i.e. inside the SNMPv1 TRAP-PDU, not UDP packet
+source address. The agent sets arbitrary local address to the TRAP PDU
+when this option is ommited.
+
+Index: snmplib/system.c
+===================================================================
+--- snmplib/system.c.orig 2008-06-05 23:11:53.000000000 +0200
++++ snmplib/system.c 2008-09-06 18:04:38.784302537 +0200
+@@ -77,6 +77,10 @@ SOFTWARE.
+ #if HAVE_NET_IF_H
+ #include <net/if.h>
+ #endif
++#if HAVE_NETDB_H
++#include <netdb.h>
++#endif
++
+
+ #if HAVE_SYS_SOCKIO_H
+ #include <sys/sockio.h>
+@@ -825,6 +829,84 @@ get_uptime(void)
+ #endif /* ! WIN32 */
+ /*******************************************************************/
+
++int
++get_thisaddr(const char* name, in_addr_t *addr_out)
++{
++
++#if HAVE_GETADDRINFO
++ struct addrinfo *addrs = NULL;
++ struct addrinfo hint;
++ int err;
++
++ memset(&hint, 0, sizeof hint);
++ hint.ai_flags = 0;
++ hint.ai_family = PF_INET;
++ hint.ai_socktype = SOCK_DGRAM;
++ hint.ai_protocol = 0;
++
++ err = getaddrinfo(name, NULL, &hint, &addrs);
++ if (err != 0) {
++#if HAVE_GAI_STRERROR
++ snmp_log(LOG_ERR, "getaddrinfo: %s %s\n", name,
++ gai_strerror(err));
++#else
++ snmp_log(LOG_ERR, "getaddrinfo: %s (error %d)\n", name,
++ err);
++#endif
++ return -1;
++ }
++ if (addrs != NULL) {
++ memcpy(addr_out,
++ &((struct sockaddr_in *) addrs->ai_addr)->sin_addr,
++ sizeof(in_addr_t));
++ freeaddrinfo(addrs);
++ } else {
++ DEBUGMSGTL(("get_thisaddr",
++ "Failed to resolve IPv4 hostname\n"));
++ }
++ return 0;
++
++#elif HAVE_GETHOSTBYNAME
++ struct hostent *hp = NULL;
++
++ hp = gethostbyname(host);
++ if (hp == NULL) {
++ DEBUGMSGTL(("get_thisaddr",
++ "hostname (couldn't resolve)\n"));
++ return -1;
++ } else if (hp->h_addrtype != AF_INET) {
++ DEBUGMSGTL(("get_thisaddr",
++ "hostname (not AF_INET!)\n"));
++ return -1;
++ } else {
++ DEBUGMSGTL(("get_thisaddr",
++ "hostname (resolved okay)\n"));
++ memcpy(addr_out, hp->h_addr, sizeof(in_addr_t));
++ }
++ return 0;
++
++#elif HAVE_GETIPNODEBYNAME
++ struct hostent *hp = NULL;
++ int err;
++
++ hp = getipnodebyname(peername, AF_INET, 0, &err);
++ if (hp == NULL) {
++ DEBUGMSGTL(("get_thisaddr",
++ "hostname (couldn't resolve = %d)\n", err));
++ return -1;
++ }
++ DEBUGMSGTL(("get_thisaddr",
++ "hostname (resolved okay)\n"));
++ memcpy(addr_out, hp->h_addr, sizeof(in_addr_t));
++ return 0;
++
++#else /* HAVE_GETIPNODEBYNAME */
++ return -1;
++#endif
++}
++
++/*******************************************************************/
++
+ #ifndef HAVE_STRNCASECMP
+
+ /*
+Index: man/snmpd.conf.5.def
+===================================================================
+--- man/snmpd.conf.5.def.orig 2008-08-07 11:00:04.000000000 +0200
++++ man/snmpd.conf.5.def 2008-09-06 18:04:38.788301614 +0200
+@@ -641,6 +641,12 @@ Ordinarily the corresponding MIB
+ object (\fCsnmpEnableAuthenTraps.0\fR) is read-write, but specifying
+ this directive makes this object read-only, and attempts to set the
+ value via SET requests will result in a \fInotWritable\fR error response.
++.RE
++.IP "v1trapaddress HOST"
++defines the agent address, which is inserted into SNMPv1 TRAPs. Arbitrary local
++IPv4 address is chosen if this option is ommited. This option is useful mainly
++when the agent is visible from outside world by specific address only (e.g.
++because of network address translation or firewall).
+ .SS "DisMan Event MIB"
+ The previous directives can be used to configure where traps should
+ be sent, but are not concerned with \fIwhen\fR to send such traps
+Index: include/net-snmp/agent/ds_agent.h
+===================================================================
+--- include/net-snmp/agent/ds_agent.h.orig 2007-05-07 22:23:23.000000000 +0200
++++ include/net-snmp/agent/ds_agent.h 2008-09-06 18:04:38.823792310 +0200
+@@ -42,6 +42,7 @@
+ #define NETSNMP_DS_AGENT_PERL_INIT_FILE 4 /* used by embedded perl */
+ #define NETSNMP_DS_SMUX_SOCKET 5 /* ip:port socket addr */
+ #define NETSNMP_DS_NOTIF_LOG_CTX 6 /* "" | "snmptrapd" */
++#define NETSNMP_DS_AGENT_TRAP_ADDR 7 /* used as v1 trap agent addres */
+
+ /*
+ * integers
+Index: include/net-snmp/library/system.h
+===================================================================
+--- include/net-snmp/library/system.h.orig 2007-01-11 23:13:56.000000000 +0100
++++ include/net-snmp/library/system.h 2008-09-06 18:04:38.855791728 +0200
+@@ -107,6 +107,8 @@ SOFTWARE.
+
+ #include <net-snmp/types.h> /* For definition of in_addr_t */
+
++ int get_thisaddr(const char* name,
++ in_addr_t *addr_out);
+ in_addr_t get_myaddr(void);
+ long get_uptime(void);
+
+Index: agent/agent_read_config.c
+===================================================================
+--- agent/agent_read_config.c.orig 2008-07-24 08:53:02.000000000 +0200
++++ agent/agent_read_config.c 2008-09-06 18:04:38.880308775 +0200
+@@ -243,6 +243,9 @@ init_agent_read_config(const char *app)
+ snmpd_free_trapcommunity,
+ "community-string");
+ #endif /* support for community based SNMP */
++ netsnmp_ds_register_config(ASN_OCTET_STR, app, "v1trapaddress",
++ NETSNMP_DS_APPLICATION_ID,
++ NETSNMP_DS_AGENT_TRAP_ADDR);
+ #ifdef HAVE_UNISTD_H
+ register_app_config_handler("agentuser",
+ snmpd_set_agent_user, NULL, "userid");
+Index: agent/agent_trap.c
+===================================================================
+--- agent/agent_trap.c.orig 2007-05-18 00:16:12.000000000 +0200
++++ agent/agent_trap.c 2008-09-06 18:06:23.367792400 +0200
+@@ -58,6 +58,7 @@
+ #include <net-snmp/utilities.h>
+
+ #include <net-snmp/net-snmp-includes.h>
++#include <net-snmp/agent/net-snmp-agent-includes.h>
+ #include <net-snmp/agent/agent_trap.h>
+ #include <net-snmp/agent/snmp_agent.h>
+ #include <net-snmp/agent/agent_callbacks.h>
+@@ -639,6 +640,8 @@ netsnmp_send_traps(int trap, int specifi
+ in_addr_t *pdu_in_addr_t;
+ u_long uptime;
+ struct trap_sink *sink;
++ const char *v1trapaddress;
++ int res;
+
+ DEBUGMSGTL(( "trap", "send_trap %d %d ", trap, specific));
+ DEBUGMSGOID(("trap", enterprise, enterprise_length));
+@@ -792,7 +795,18 @@ netsnmp_send_traps(int trap, int specifi
+ * Ensure that the v1 trap PDU includes the local IP address
+ */
+ pdu_in_addr_t = (in_addr_t *) template_v1pdu->agent_addr;
+- *pdu_in_addr_t = get_myaddr();
++
++ v1trapaddress = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
++ NETSNMP_DS_AGENT_TRAP_ADDR);
++ if (v1trapaddress != NULL) {
++ /* "v1trapaddress" was specified in config, try to resolve it */
++ res = get_thisaddr(v1trapaddress, pdu_in_addr_t);
++ }
++ if (v1trapaddress == NULL || res < 0) {
|
[-]
[+]
|
Deleted |
net-snmp-5.3.0.1_tunnel_compilation.patch
^
|
@@ -1,65 +0,0 @@
-=== agent/mibgroup/tunnel/tunnel.c
-==================================================================
---- agent/mibgroup/tunnel/tunnel.c (revision 23990)
-+++ agent/mibgroup/tunnel/tunnel.c (revision 23991)
-@@ -75,12 +75,16 @@
-
-
-
-+#ifdef USING_IF_MIB_IFTABLE_IFTABLE_MODULE
-+#include "if-mib/ifTable/ifTable.h"
-+#else
- /*
- * This is used, because the TUNNEL-MIB augments ifTable.
- */
- extern unsigned char *var_ifEntry(struct variable *,
- oid *, size_t *,
- int, size_t *, WriteMethod **);
-+#endif
-
-
- /*
-@@ -204,6 +208,7 @@
- static int
- getType(int index)
- {
-+#ifndef USING_IF_MIB_IFTABLE_IFTABLE_MODULE
- oid name[MAX_OID_LEN] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 3 };
- size_t length = 10;
- struct variable ifType_variable =
-@@ -224,6 +229,17 @@
- return 0;
-
- return *(int *) p;
-+#else
-+ ifTable_mib_index imi;
-+ ifTable_rowreq_ctx *rr;
-+
-+ imi.ifIndex = index;
-+ rr = ifTable_row_find_by_mib_index(&imi);
-+ if (NULL == rr)
-+ return 0;
-+
-+ return rr->data.ifType;
-+#endif
- }
-
-
-@@ -231,6 +247,7 @@
- static char *
- getName(int index)
- {
-+#ifndef USING_IF_MIB_IFTABLE_IFTABLE_MODULE
- oid name[MAX_OID_LEN] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 2 };
- size_t length = 10;
- struct variable ifName_variable =
-@@ -251,6 +268,9 @@
- return NULL;
-
- return p;
-+#else
-+ return netsnmp_access_interface_name_find(index);
-+#endif
- }
-
-
|
[-]
[+]
|
Deleted |
net-snmp-5.3.1-smux-password.diff
^
|
@@ -1,40 +0,0 @@
-Index: agent/mibgroup/smux/smux.c
-===================================================================
-RCS file: /cvsroot/net-snmp/net-snmp/agent/mibgroup/smux/smux.c,v
-retrieving revision 5.18
-diff -u -r5.18 smux.c
---- agent/mibgroup/smux/smux.c 15 Sep 2006 00:48:41 -0000 5.18
-+++ agent/mibgroup/smux/smux.c 19 Sep 2006 14:55:13 -0000
-@@ -137,6 +137,8 @@
- smux_parse_peer_auth(const char *token, char *cptr)
- {
- smux_peer_auth *aptr;
-+ char *password_cptr;
-+ int cptr_len;
-
- if ((aptr =
- (smux_peer_auth *) calloc(1, sizeof(smux_peer_auth))) == NULL) {
-@@ -160,13 +162,21 @@
- /*
- * oid
- */
-+ password_cptr = strchr(cptr, ' ');
-+ cptr_len = strlen(cptr);
-+ if (password_cptr)
-+ *password_cptr = 0x0;
-+
- aptr->sa_oid_len = MAX_OID_LEN;
- read_objid( cptr, aptr->sa_oid, &aptr->sa_oid_len );
-
- DEBUGMSGTL(("smux_conf", "parsing registration for: %s\n", cptr));
-
-- cptr = skip_token(cptr);
-- DEBUGMSGTL(("smux_conf", "password is: %s\n", cptr ? cptr : "NULL"));
-+ if ((&password_cptr - &cptr + 1) < cptr_len) {
-+ cptr = ++password_cptr;
-+ DEBUGMSGTL(("smux_conf", "password is: %s\n",
-+ cptr ? cptr : "NULL"));
-+ }
-
- /*
- * password
|
[-]
[+]
|
Deleted |
net-snmp-5.3_perl-printf.patch
^
|
@@ -1,13 +0,0 @@
-Index: perl/TrapReceiver/TrapReceiver.xs
-===================================================================
---- perl/TrapReceiver/TrapReceiver.xs.orig
-+++ perl/TrapReceiver/TrapReceiver.xs
-@@ -248,7 +248,7 @@
- netsnmp_add_default_traphandler(perl_trapd_handler);
- } else if (!snmp_parse_oid(regoid, myoid, &myoid_len)) {
- snmp_log(LOG_ERR,
-- "Failed to parse oid for perl registration: %s %d\n",
-+ "Failed to parse oid for perl registration: %s\n",
- regoid);
- RETVAL = 0;
- return;
|
[-]
[+]
|
Deleted |
net-snmp-5.3_perl_agent.xs-pointersize.patch
^
|
@@ -1,230 +0,0 @@
-Index: perl/agent/agent.xs
-===================================================================
---- perl/agent/agent.xs.orig
-+++ perl/agent/agent.xs
-@@ -394,19 +394,19 @@
- PUSHMARK(sp);
- rarg = newSViv(0);
- arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_mib_handler");
-- sv_setiv(arg, (int) handler);
-+ sv_setiv(arg, (IV) handler);
- XPUSHs(sv_2mortal(rarg));
- rarg = newSViv(0);
- arg = newSVrv(rarg, "NetSNMP::agent::reginfo");
-- sv_setiv(arg, (int) reginfo);
-+ sv_setiv(arg, (IV) reginfo);
- XPUSHs(sv_2mortal(rarg));
- rarg = newSViv(0);
- arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_agent_request_info");
-- sv_setiv(arg, (int) reqinfo);
-+ sv_setiv(arg, (IV) reqinfo);
- XPUSHs(sv_2mortal(rarg));
- rarg = newSViv(0);
- arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_request_infoPtr");
-- sv_setiv(arg, (int) requests);
-+ sv_setiv(arg, (IV) requests);
- XPUSHs(sv_2mortal(rarg));
- PUTBACK;
- if (SvTYPE(cb) == SVt_PVCV) {
-@@ -567,7 +567,7 @@
-
- rarg = newSViv((int) 0);
- arg = newSVrv(rarg, "netsnmp_oidPtr");
-- sv_setiv(arg, (int) o);
-+ sv_setiv(arg, (IV) o);
-
- XPUSHs(rarg);
-
-@@ -606,7 +606,7 @@
-
- rarg = newSViv((int) 0);
- arg = newSVrv(rarg, "netsnmp_oidPtr");
-- sv_setiv(arg, (int) o);
-+ sv_setiv(arg, (IV) o);
-
- XPUSHs(rarg);
-
-@@ -996,7 +996,7 @@
- request = request->next;
- rarg = newSViv(0);
- arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_request_infoPtr");
-- sv_setiv(arg, (int) request);
-+ sv_setiv(arg, (IV) request);
- ST(0) = rarg;
- } else {
- ST(0) = &sv_undef;
-Index: snmplib/md5.c
-===================================================================
---- snmplib/md5.c.orig
-+++ snmplib/md5.c
-@@ -465,7 +465,7 @@
- goto update_end;
-
- i = len;
-- if (((unsigned int) data) % sizeof(long) != 0) {
-+ if (((uintptr_t) data) % sizeof(long) != 0) {
- /*
- * this relies on the ability to use integer math and thus we
- * must rely on data that aligns on 32-bit-word-boundries
-Index: snmplib/snmp_logging.c
-===================================================================
---- snmplib/snmp_logging.c.orig
-+++ snmplib/snmp_logging.c
-@@ -380,7 +380,7 @@
- if (facility == -1) return -1;
- logh->pri_max = pri_max;
- logh->token = strdup(snmp_log_syslogname(0));
-- logh->magic = (void *)facility;
-+ logh->magic = (void *)(intptr_t)facility;
- snmp_enable_syslog_ident(snmp_log_syslogname(0), facility);
- }
- break;
-@@ -625,7 +625,7 @@
- continue;
- if (logh->type == NETSNMP_LOGHANDLER_SYSLOG) {
- snmp_disable_syslog_entry(logh);
-- snmp_enable_syslog_ident(logh->token,(int)logh->magic);
-+ snmp_enable_syslog_ident(logh->token,(int)(intptr_t)logh->magic);
- }
- else if (logh->type == NETSNMP_LOGHANDLER_FILE) {
- snmp_disable_filelog_entry(logh);
-@@ -1041,7 +1041,7 @@
- */
- if (!(logh->imagic)) {
- const char *ident = logh->token;
-- int facility = (int)logh->magic;
-+ int facility = (int)(intptr_t)logh->magic;
- if (!ident)
- ident = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
- NETSNMP_DS_LIB_APPTYPE);
-Index: snmplib/text_utils.c
-===================================================================
---- snmplib/text_utils.c.orig
-+++ snmplib/text_utils.c
-@@ -460,7 +460,7 @@
- /*
- * get value
- */
-- switch((int)lpi->user_context) {
-+ switch((int)(intptr_t)lpi->user_context) {
-
- case PMLP_TYPE_UNSIGNED:
- tvi->value.ul = strtoul(ptr, NULL, 0);
-@@ -496,7 +496,7 @@
-
- default:
- snmp_log(LOG_ERR,"unsupported value type %d\n",
-- (int)lpi->user_context);
-+ (int)(intptr_t)lpi->user_context);
- break;
- }
-
-Index: agent/helpers/row_merge.c
-===================================================================
---- agent/helpers/row_merge.c.orig
-+++ agent/helpers/row_merge.c
-@@ -30,7 +30,7 @@
- ret = netsnmp_create_handler("row_merge",
- netsnmp_row_merge_helper_handler);
- if (ret) {
-- ret->myvoid = (void *) prefix_len;
-+ ret->myvoid = (void *)(intptr_t)prefix_len;
- }
- return ret;
- }
-@@ -164,7 +164,7 @@
- * Use the prefix length as supplied during registration, rather
- * than trying to second-guess what the MIB implementer wanted.
- */
-- int SKIP_OID = (int)handler->myvoid;
-+ int SKIP_OID = (int)(intptr_t)handler->myvoid;
-
- DEBUGMSGTL(("helper:row_merge", "Got request (%d): ", SKIP_OID));
- DEBUGMSGOID(("helper:row_merge", reginfo->rootoid, reginfo->rootoid_len));
-Index: agent/mibgroup/agent/nsDebug.c
-===================================================================
---- agent/mibgroup/agent/nsDebug.c.orig
-+++ agent/mibgroup/agent/nsDebug.c
-@@ -291,7 +291,7 @@
-
- snmp_set_var_value(index, dbg_tokens[i].token_name,
- strlen(dbg_tokens[i].token_name));
-- *loop_context = (void*)i;
-+ *loop_context = (void*)(intptr_t)i;
- *data_context = (void*)&dbg_tokens[i];
- return index;
- }
-@@ -301,7 +301,7 @@
- netsnmp_variable_list *index,
- netsnmp_iterator_info *data)
- {
-- int i = (int)*loop_context;
-+ int i = (int)(intptr_t)*loop_context;
-
- for (i++; i<debug_num_tokens; i++) {
- /* skip excluded til mib is updated */
-@@ -313,7 +313,7 @@
-
- snmp_set_var_value(index, dbg_tokens[i].token_name,
- strlen(dbg_tokens[i].token_name));
-- *loop_context = (void*)i;
-+ *loop_context = (void*)(intptr_t)i;
- *data_context = (void*)&dbg_tokens[i];
- return index;
- }
-Index: perl/SNMP/SNMP.xs
-===================================================================
---- perl/SNMP/SNMP.xs.orig
-+++ perl/SNMP/SNMP.xs
-@@ -1891,7 +1891,7 @@
- ** we sent in this request. Note that this is not a valid SNMP PDU,
- ** but that's because a response has not yet been received.
- */
-- return (netsnmp_pdu *)reqid;
-+ return (netsnmp_pdu *)(intptr_t)reqid;
- }
-
- /* This code is for synchronous mode support.
-@@ -2944,7 +2944,7 @@
- if (verbose) warn("failed\n");
- }
- }
-- RETVAL = (I32)get_tree_head();
-+ RETVAL = (IV)get_tree_head();
- }
- OUTPUT:
- RETVAL
-@@ -2967,7 +2967,7 @@
- } else {
- if (verbose) warn("Failed reading %s\n", module);
|
[-]
[+]
|
Deleted |
net-snmp-5.3_vendorperl.patch
^
|
@@ -1,13 +0,0 @@
-Index: Makefile.in
-===================================================================
---- Makefile.in.orig
-+++ Makefile.in
-@@ -167,7 +167,7 @@
- fi
-
- perlinstall:
-- @(cd perl ; $(MAKE) install) ; \
-+ @(cd perl ; $(MAKE) install_vendor) ; \
- if test $$? != 0 ; then \
- exit 1 ; \
- fi
|
[-]
[+]
|
Added |
net-snmp-5.4.1.2-etherlike-mib-revised_2.patch
^
|
@@ -0,0 +1,4603 @@
+Index: agent/mibgroup/etherlike-mib/dot3StatsTable.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ agent/mibgroup/etherlike-mib/dot3StatsTable.c 2008-11-21 14:49:15.697017950 +0100
+@@ -0,0 +1,212 @@
++/*
++ * Note: this file originally auto-generated by mib2c using
++ * version : 14170 $ of $
++ *
++ * $Id:$
++ */
++/** \page MFD helper for dot3StatsTable
++ *
++ * \section intro Introduction
++ * Introductory text.
++ *
++ */
++/*
++ * standard Net-SNMP includes
++ */
++#include <net-snmp/net-snmp-config.h>
++#include <net-snmp/net-snmp-includes.h>
++#include <net-snmp/agent/net-snmp-agent-includes.h>
++
++/*
++ * include our parent header
++ */
++#include "dot3StatsTable.h"
++
++#include <net-snmp/agent/mib_modules.h>
++
++#include "dot3StatsTable_interface.h"
++
++oid dot3StatsTable_oid[] = { DOT3STATSTABLE_OID };
++int dot3StatsTable_oid_size = OID_LENGTH(dot3StatsTable_oid);
++
++dot3StatsTable_registration dot3StatsTable_user_context;
++
++void initialize_table_dot3StatsTable(void);
++void shutdown_table_dot3StatsTable(void);
++
++
++/**
++ * Initializes the dot3StatsTable module
++ */
++void
++init_dot3StatsTable(void)
++{
++ DEBUGMSGTL(("verbose:dot3StatsTable:init_dot3StatsTable", "called\n"));
++
++ /*
++ * TODO:300:o: Perform dot3StatsTable one-time module initialization.
++ */
++
++ /*
++ * here we initialize all the tables we're planning on supporting
++ */
++ if (should_init("dot3StatsTable"))
++ initialize_table_dot3StatsTable();
++
++} /* init_dot3StatsTable */
++
++/**
++ * Shut-down the dot3StatsTable module (agent is exiting)
++ */
++void
++shutdown_dot3StatsTable(void)
++{
++ if (should_init("dot3StatsTable"))
++ shutdown_table_dot3StatsTable();
++
++}
++
++/**
++ * Initialize the table dot3StatsTable
++ * (Define its contents and how it's structured)
++ */
++void
++initialize_table_dot3StatsTable(void)
++{
++ dot3StatsTable_registration *user_context;
++ u_long flags;
++
++ DEBUGMSGTL(("verbose:dot3StatsTable:initialize_table_dot3StatsTable",
++ "called\n"));
++
++ /*
++ * TODO:301:o: Perform dot3StatsTable one-time table initialization.
++ */
++
++ /*
++ * TODO:302:o: |->Initialize dot3StatsTable user context
++ * if you'd like to pass in a pointer to some data for this
++ * table, allocate or set it up here.
++ */
++ /*
++ * a netsnmp_data_list is a simple way to store void pointers. A simple
++ * string token is used to add, find or remove pointers.
++ */
++ user_context = netsnmp_create_data_list("dot3StatsTable", NULL, NULL);
++
++ /*
++ * No support for any flags yet, but in the future you would
++ * set any flags here.
++ */
++ flags = 0;
++
++ /*
++ * call interface initialization code
++ */
++ _dot3StatsTable_initialize_interface(user_context, flags);
++} /* initialize_table_dot3StatsTable */
++
++/**
++ * Shutdown the table dot3StatsTable
++ */
++void
++shutdown_table_dot3StatsTable(void)
++{
++ /*
++ * call interface shutdown code
++ */
++ _dot3StatsTable_shutdown_interface(&dot3StatsTable_user_context);
++}
++
++/**
++ * extra context initialization (eg default values)
++ *
++ * @param rowreq_ctx : row request context
++ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
++ *
++ * @retval MFD_SUCCESS : no errors
++ * @retval MFD_ERROR : error (context allocate will fail)
++ */
++int
++dot3StatsTable_rowreq_ctx_init(dot3StatsTable_rowreq_ctx * rowreq_ctx,
++ void *user_init_ctx)
++{
++ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_rowreq_ctx_init",
++ "called\n"));
++
++ netsnmp_assert(NULL != rowreq_ctx);
++
++ /*
++ * TODO:210:o: |-> Perform extra dot3StatsTable rowreq initialization. (eg DEFVALS)
++ */
++
++ return MFD_SUCCESS;
++} /* dot3StatsTable_rowreq_ctx_init */
++
++/**
++ * extra context cleanup
++ *
++ */
++void
++dot3StatsTable_rowreq_ctx_cleanup(dot3StatsTable_rowreq_ctx * rowreq_ctx)
++{
++ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_rowreq_ctx_cleanup",
++ "called\n"));
++
++ netsnmp_assert(NULL != rowreq_ctx);
++
++ /*
++ * TODO:211:o: |-> Perform extra dot3StatsTable rowreq cleanup.
++ */
++} /* dot3StatsTable_rowreq_ctx_cleanup */
++
++/**
++ * pre-request callback
++ *
++ *
++ * @retval MFD_SUCCESS : success.
++ * @retval MFD_ERROR : other error
++ */
++int
++dot3StatsTable_pre_request(dot3StatsTable_registration * user_context)
++{
++ DEBUGMSGTL(("verbose:dot3StatsTable:dot3StatsTable_pre_request",
++ "called\n"));
++
++ /*
++ * TODO:510:o: Perform dot3StatsTable pre-request actions.
++ */
++
++ return MFD_SUCCESS;
++} /* dot3StatsTable_pre_request */
++
++/**
++ * post-request callback
++ *
++ * Note:
++ * New rows have been inserted into the container, and
++ * deleted rows have been removed from the container and
++ * released.
++ *
++ * @param user_context
++ * @param rc : MFD_SUCCESS if all requests succeeded
++ *
++ * @retval MFD_SUCCESS : success.
|
[-]
[+]
|
Added |
net-snmp-5.4.1.2-rmon-mib-revised.patch
^
|
@@ -0,0 +1,6936 @@
+Index: agent/mibgroup/rmon-mib/etherStatsTable.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ agent/mibgroup/rmon-mib/etherStatsTable.c 2008-09-16 16:36:41.339791677 +0200
+@@ -0,0 +1,229 @@
++/*
++ * Note: this file originally auto-generated by mib2c using
++ * version : 14170 $ of $
++ *
++ * $Id:$
++ */
++/** \page MFD helper for etherStatsTable
++ *
++ * \section intro Introduction
++ * Introductory text.
++ *
++ */
++/*
++ * standard Net-SNMP includes
++ */
++#include <net-snmp/net-snmp-config.h>
++#include <net-snmp/net-snmp-includes.h>
++#include <net-snmp/agent/net-snmp-agent-includes.h>
++
++/*
++ * include our parent header
++ */
++#include "etherStatsTable.h"
++
++#include <net-snmp/agent/mib_modules.h>
++
++#include "etherStatsTable_interface.h"
++
++oid etherStatsTable_oid[] = { ETHERSTATSTABLE_OID };
++int etherStatsTable_oid_size = OID_LENGTH(etherStatsTable_oid);
++
++etherStatsTable_registration etherStatsTable_user_context;
++
++void initialize_table_etherStatsTable(void);
++void shutdown_table_etherStatsTable(void);
++
++
++/**
++ * Initializes the etherStatsTable module
++ */
++void
++init_etherStatsTable(void)
++{
++ DEBUGMSGTL(("verbose:etherStatsTable:init_etherStatsTable",
++ "called\n"));
++
++ /*
++ * TODO:300:o: Perform etherStatsTable one-time module initialization.
++ */
++
++ /*
++ * here we initialize all the tables we're planning on supporting
++ */
++ if (should_init("etherStatsTable"))
++ initialize_table_etherStatsTable();
++
++} /* init_etherStatsTable */
++
++/**
++ * Shut-down the etherStatsTable module (agent is exiting)
++ */
++void
++shutdown_etherStatsTable(void)
++{
++ if (should_init("etherStatsTable"))
++ shutdown_table_etherStatsTable();
++
++}
++
++/**
++ * Initialize the table etherStatsTable
++ * (Define its contents and how it's structured)
++ */
++void
++initialize_table_etherStatsTable(void)
++{
++ etherStatsTable_registration *user_context;
++ u_long flags;
++
++ DEBUGMSGTL(("verbose:etherStatsTable:initialize_table_etherStatsTable",
++ "called\n"));
++
++ /*
++ * TODO:301:o: Perform etherStatsTable one-time table initialization.
++ */
++
++ /*
++ * TODO:302:o: |->Initialize etherStatsTable user context
++ * if you'd like to pass in a pointer to some data for this
++ * table, allocate or set it up here.
++ */
++ /*
++ * a netsnmp_data_list is a simple way to store void pointers. A simple
++ * string token is used to add, find or remove pointers.
++ */
++ user_context = netsnmp_create_data_list("etherStatsTable", NULL, NULL);
++
++ /*
++ * No support for any flags yet, but in the future you would
++ * set any flags here.
++ */
++ flags = 0;
++
++ /*
++ * call interface initialization code
++ */
++ _etherStatsTable_initialize_interface(user_context, flags);
++} /* initialize_table_etherStatsTable */
++
++/**
++ * Shutdown the table etherStatsTable
++ */
++void
++shutdown_table_etherStatsTable(void)
++{
++ /*
++ * call interface shutdown code
++ */
++ _etherStatsTable_shutdown_interface(ðerStatsTable_user_context);
++}
++
++/**
++ * extra context initialization (eg default values)
++ *
++ * @param rowreq_ctx : row request context
++ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
++ *
++ * @retval MFD_SUCCESS : no errors
++ * @retval MFD_ERROR : error (context allocate will fail)
++ */
++int
++etherStatsTable_rowreq_ctx_init(etherStatsTable_rowreq_ctx * rowreq_ctx,
++ void *user_init_ctx)
++{
++ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_rowreq_ctx_init",
++ "called\n"));
++
++ netsnmp_assert(NULL != rowreq_ctx);
++
++ /*
++ * TODO:210:o: |-> Perform extra etherStatsTable rowreq initialization. (eg DEFVALS)
++ */
++
++ return MFD_SUCCESS;
++} /* etherStatsTable_rowreq_ctx_init */
++
++/**
++ * extra context cleanup
++ *
++ */
++void
++etherStatsTable_rowreq_ctx_cleanup(etherStatsTable_rowreq_ctx * rowreq_ctx)
++{
++ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_rowreq_ctx_cleanup", "called\n"));
++
++ netsnmp_assert(NULL != rowreq_ctx);
++
++ /*
++ * TODO:211:o: |-> Perform extra etherStatsTable rowreq cleanup.
++ */
++} /* etherStatsTable_rowreq_ctx_cleanup */
++
++/**
++ * pre-request callback
++ *
++ *
++ * @retval MFD_SUCCESS : success.
++ * @retval MFD_ERROR : other error
++ */
++int
++etherStatsTable_pre_request(etherStatsTable_registration * user_context)
++{
++ DEBUGMSGTL(("verbose:etherStatsTable:etherStatsTable_pre_request",
++ "called\n"));
++
++ /*
++ * TODO:510:o: Perform etherStatsTable pre-request actions.
++ */
++
++ return MFD_SUCCESS;
++} /* etherStatsTable_pre_request */
++
++/**
++ * post-request callback
++ *
++ * Note:
++ * New rows have been inserted into the container, and
++ * deleted rows have been removed from the container and
++ * released.
++ *
++ * @param user_context
++ * @param rc : MFD_SUCCESS if all requests succeeded
++ *
++ * @retval MFD_SUCCESS : success.
|
[-]
[+]
|
Added |
net-snmp-5.4.2_audit.patch
^
|
@@ -0,0 +1,222 @@
+Index: agent/mibgroup/examples/ucdDemoPublic.c
+===================================================================
+--- agent/mibgroup/examples/ucdDemoPublic.c.orig 2002-12-19 16:07:36.000000000 +0100
++++ agent/mibgroup/examples/ucdDemoPublic.c 2008-10-24 15:30:26.538387687 +0200
+@@ -219,7 +219,11 @@ write_ucdDemoPublicString(int action,
+ }
+ if (action == COMMIT) {
+ if (var_val_len != 0) {
+- strcpy(publicString, var_val);
++ strncpy(publicString, var_val, sizeof(publicString)-1);
++ /* XXX thomas: just some sanity checks */
++ if(strlen(var_val) > sizeof(publicString)-1 || strlen(var_val) != var_val_len)
++ publicString[sizeof(publicString)-1] = '\0';
++ else
+ publicString[var_val_len] = '\0';
+ } else
+ publicString[0] = '\0';
+Index: agent/mibgroup/mibII/system_mib.c
+===================================================================
+--- agent/mibgroup/mibII/system_mib.c.orig 2006-09-15 02:48:50.000000000 +0200
++++ agent/mibgroup/mibII/system_mib.c 2008-10-24 15:30:26.550386000 +0200
+@@ -126,7 +126,7 @@ system_parse_config_sysloc(const char *t
+ char tmpbuf[1024];
+
+ if (strlen(cptr) >= sizeof(sysLocation)) {
+- snprintf(tmpbuf, 1024,
++ snprintf(tmpbuf, sizeof(tmpbuf),
+ "syslocation token too long (must be < %lu):\n\t%s",
+ (unsigned long)sizeof(sysLocation), cptr);
+ config_perror(tmpbuf);
+@@ -173,7 +173,7 @@ system_parse_config_syscon(const char *t
+ char tmpbuf[1024];
+
+ if (strlen(cptr) >= sizeof(sysContact)) {
+- snprintf(tmpbuf, 1024,
++ snprintf(tmpbuf, sizeof(tmpbuf),
+ "syscontact token too long (must be < %lu):\n\t%s",
+ (unsigned long)sizeof(sysContact), cptr);
+ config_perror(tmpbuf);
+@@ -220,7 +220,7 @@ system_parse_config_sysname(const char *
+ char tmpbuf[1024];
+
+ if (strlen(cptr) >= sizeof(sysName)) {
+- snprintf(tmpbuf, 1024,
++ snprintf(tmpbuf, sizeof(tmpbuf),
+ "sysname token too long (must be < %lu):\n\t%s",
+ (unsigned long)sizeof(sysName), cptr);
+ config_perror(tmpbuf);
+Index: agent/mibgroup/mibII/var_route.c
+===================================================================
+--- agent/mibgroup/mibII/var_route.c.orig 2008-07-28 16:39:55.000000000 +0200
++++ agent/mibgroup/mibII/var_route.c 2008-10-24 15:30:26.582385351 +0200
+@@ -1381,7 +1381,7 @@ Route_Scan_Reload(void)
+ /*
+ * Sort it!
+ */
+- qsort((char *) rthead, rtsize, sizeof(rthead[0]), qsort_compare);
++ qsort((char *) rthead, rtsize, sizeof(rthead[0]), (int (*) (const void*, const void*)) qsort_compare);
+ }
+ #endif
+ #endif
+Index: agent/mibgroup/util_funcs.c
+===================================================================
+--- agent/mibgroup/util_funcs.c.orig 2007-08-16 16:12:47.000000000 +0200
++++ agent/mibgroup/util_funcs.c 2008-10-24 15:30:26.598384777 +0200
+@@ -140,6 +140,10 @@ make_tempfile(void)
+ }
+ #endif
+ if (fd >= 0) {
++ if(fchmod(fd, 0600) != 0) {
++ close(fd);
++ return NULL;
++ }
+ close(fd);
+ DEBUGMSGTL(("make_tempfile", "temp file created: %s\n", name));
+ return name;
+Index: agent/auto_nlist.c
+===================================================================
+--- agent/auto_nlist.c.orig 2008-06-05 23:11:53.000000000 +0200
++++ agent/auto_nlist.c 2008-10-24 15:30:26.630385059 +0200
+@@ -64,6 +64,7 @@ auto_nlist_value(const char *string)
+ it->nl[0].n_name = (char *) malloc(strlen(string) + 2);
+ #if defined(aix4) || defined(aix5) || defined(aix6)
+ strcpy(it->nl[0].n_name, string);
++ it->nl[0].n_name[strlen(string)+1] = '\0';
+ #else
+ sprintf(it->nl[0].n_name, "_%s", string);
+ #endif
+@@ -72,6 +73,7 @@ auto_nlist_value(const char *string)
+ #if !(defined(aix4) || defined(aix5) || defined(aix6))
+ if (it->nl[0].n_type == 0) {
+ strcpy(it->nl[0].n_name, string);
++ it->nl[0].n_name[strlen(string)+1] = '\0';
+ init_nlist(it->nl);
+ }
+ #endif
+Index: apps/snmptest.c
+===================================================================
+--- apps/snmptest.c.orig 2008-05-29 11:59:06.000000000 +0200
++++ apps/snmptest.c 2008-10-24 15:30:26.650386319 +0200
+@@ -456,6 +456,7 @@ input_variable(netsnmp_variable_list * v
+ goto getValue;
+ }
+ memcpy(vp->val.string, buf, strlen(buf) - 1);
++ vp->val.string[sizeof(vp->val.string)-1] = 0;
+ vp->val_len = strlen(buf) - 1;
+ } else if (ch == 'x') {
+ size_t buf_len = 256;
+Index: apps/snmptrapd_handlers.c
+===================================================================
+--- apps/snmptrapd_handlers.c.orig 2007-06-08 12:44:37.000000000 +0200
++++ apps/snmptrapd_handlers.c 2008-10-24 15:30:26.682736940 +0200
+@@ -24,6 +24,9 @@
+ #include <sys/wait.h>
+ #endif
+
++#include <sys/stat.h>
++#include <fcntl.h>
++
+ #include <net-snmp/config_api.h>
+ #include <net-snmp/output_api.h>
+ #include <net-snmp/mib_api.h>
+@@ -863,10 +866,11 @@ do_external(char *cmd, struct hostent *h
+ #else
+ char command_buf[128];
+ char file_buf[L_tmpnam];
++ int win_fd;
+
+ tmpnam(file_buf);
+- file = fopen(file_buf, "w");
+- if (!file) {
++ win_fd = open(file_buf, O_RDWR | O_CREAT | O_EXCL, 0600);
++ if (win_fd < 0 || (file = fdopen(win_fd, "w")) == NULL)
+ fprintf(stderr, "fopen: %s: %s\n", file_buf, strerror(errno));
+ } else {
+ send_handler_data(file, host, pdu, transport);
+Index: snmplib/parse.c
+===================================================================
+--- snmplib/parse.c.orig 2008-04-07 16:00:44.000000000 +0200
++++ snmplib/parse.c 2008-10-24 15:30:26.706385615 +0200
+@@ -4191,7 +4191,7 @@ static struct node *
+ parse(FILE * fp, struct node *root)
+ {
+ char token[MAXTOKEN];
+- char name[MAXTOKEN];
++ char name[MAXTOKEN+1];
+ int type = LABEL;
+ int lasttype = LABEL;
+
+@@ -4283,7 +4283,8 @@ parse(FILE * fp, struct node *root)
+ case ENDOFFILE:
+ continue;
+ default:
+- strcpy(name, token);
++ strncpy(name, token, sizeof(name));
++ name[sizeof(name)-1] = '\0';
+ type = get_token(fp, token, MAXTOKEN);
+ nnp = NULL;
+ if (type == MACRO) {
+@@ -4300,7 +4301,8 @@ parse(FILE * fp, struct node *root)
+ print_error(name, "is a reserved word", lasttype);
+ continue; /* see if we can parse the rest of the file */
+ }
+- strcpy(name, token);
++ strncpy(name, token, sizeof(name));
++ name[sizeof(name)-1] = '\0';
+ type = get_token(fp, token, MAXTOKEN);
+ nnp = NULL;
+
+Index: snmplib/tools.c
+===================================================================
+--- snmplib/tools.c.orig 2007-02-21 14:58:27.000000000 +0100
++++ snmplib/tools.c 2008-10-24 15:30:26.750385578 +0200
+@@ -696,7 +696,7 @@ dump_snmpEngineID(const u_char * estring
+ /*
+ * s += snprintf(s, remaining_len+3, "\"%s\"", esp);
+ */
+- s += sprintf(s, "\"%s\"", esp);
++ s += sprintf(s, "\"%.*s\"", sizeof(buf)-strlen(buf)-3, esp);
+ goto dump_snmpEngineID_quit;
+ break;
+ /*NOTREACHED*/ case 5: /* Octets. */
+Index: testing/TESTCONF.sh
+===================================================================
+--- testing/TESTCONF.sh.orig 2006-08-07 17:34:16.000000000 +0200
++++ testing/TESTCONF.sh 2008-10-24 15:30:26.774385440 +0200
+@@ -77,8 +77,8 @@ if [ "x$SNMP_TMPDIR" = "x" -a "x$SNMP_HE
+ fi
+ SNMP_TMP_PERSISTENTDIR=$SNMP_TMPDIR/persist
+ export SNMP_TMP_PERSISTENTDIR
+- mkdir $SNMP_TMPDIR
+- mkdir $SNMP_TMP_PERSISTENTDIR
++ mkdir -m 0700 $SNMP_TMPDIR
++ mkdir -m 0700 $SNMP_TMP_PERSISTENTDIR
+ fi
+
+ if [ "x$SNMP_SAVE_TMPDIR" = "x" ]; then
+Index: testing/eval_suite.sh
+===================================================================
|
[-]
[+]
|
Added |
net-snmp-5.4.2_autoconf.patch
^
|
@@ -0,0 +1,40 @@
+Index: configure.in
+===================================================================
+--- configure.in.orig 2008-09-05 11:27:25.000000000 +0200
++++ configure.in 2008-10-24 15:30:38.018389374 +0200
+@@ -1025,7 +1025,7 @@ AC_SUBST(LINKCC)
+ AC_AIX
+
+ # system check
+-AC_CANONICAL_TARGET
++AC_CANONICAL_TARGET([])
+ changequote(, )
+ PARTIALTARGETOS=`echo $target_os | sed 's/[-._].*//'`
+ changequote([, ])
+@@ -2756,8 +2756,6 @@ AC_ARG_WITH(libwrap,
+ [
+ AC_MSG_RESULT([no])
+ # Linux RedHat 6.1 won't link libwrap without libnsl
+- AC_CHECK_FUNC(yp_get_default_domain, ,
+- AC_CHECK_LIB(nsl, yp_get_default_domain))
+ AC_MSG_CHECKING([for TCP wrappers library -lwrap linked with -lnsl])
+ AC_TRY_LINK([#include <sys/types.h>
+ #include <tcpd.h>
+@@ -4555,7 +4553,7 @@ fi
+ # we need to have a local variable `hz' in scope and set to a useful
+ # value whenever we use one of these constants.
+ #
+-AC_CACHE_CHECK(whether TCP timers depend on \`hz',ac_cv_TCPTV_NEEDS_HZ,
++AC_CACHE_CHECK(whether TCP timers depend on hz,ac_cv_TCPTV_NEEDS_HZ,
+ [AC_EGREP_CPP(hz,
+ [#include <netinet/tcp_timer.h>
+ TCPTV_SRTTDFLT
+@@ -4609,7 +4607,7 @@ fi
+
+ ME=`$WHOAMI`
+ if test -f /etc/resolv.conf; then
+- LOC=`cat /etc/resolv.conf | grep '^domain' | tail -1 | awk '{print $NF}'`
++ LOC=`cat /etc/resolv.conf | grep '^domain' | tail -n 1 | awk '{print $NF}'`
+ else
+ LOC="@no.where"
+ fi
|
[-]
[+]
|
Added |
net-snmp-5.4.2_overflow.patch
^
|
@@ -0,0 +1,22 @@
+Index: snmplib/mib.c
+===================================================================
+--- snmplib/mib.c.orig 2008-07-30 09:57:19.000000000 +0200
++++ snmplib/mib.c 2008-10-24 15:30:42.854387100 +0200
+@@ -1489,7 +1489,7 @@ sprint_realloc_gauge(u_char ** buf, size
+ return 0;
+ }
+ } else {
+- sprintf(tmp, "%lu", *var->val.integer);
++ sprintf(tmp, "%u", (unsigned int)(*var->val.integer & 0xffffffff));
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) tmp)) {
+ return 0;
+@@ -1553,7 +1553,7 @@ sprint_realloc_counter(u_char ** buf, si
+ return 0;
+ }
+ }
+- sprintf(tmp, "%lu", *var->val.integer);
++ sprintf(tmp, "%u", (unsigned int)(*var->val.integer & 0xffffffff));
+ if (!snmp_strcat
+ (buf, buf_len, out_len, allow_realloc, (const u_char *) tmp)) {
+ return 0;
|
[-]
[+]
|
Added |
net-snmp-5.4.2_perl_tk_warning.patch
^
|
@@ -0,0 +1,17 @@
+Index: local/tkmib
+===================================================================
+--- local/tkmib.orig 2006-07-27 21:48:25.000000000 +0200
++++ local/tkmib 2008-10-24 15:31:02.574384593 +0200
+@@ -27,10 +27,9 @@ instructions.
+
+ if (!$havetk) {
+ print "
+-ERROR: You don't have the Tk module installed. You should be able to
+-install this by running (as root):
++ERROR: You don't have the Tk module installed.
+
+- perl -MCPAN -e 'install Tk'
++ Please install the perl-Tk package.
+ ";
+ }
+
|
[-]
[+]
|
Added |
net-snmp-5.4.2_snmpconf-selinux.patch
^
|
@@ -0,0 +1,14 @@
+https://bugzilla.redhat.com/show_bug.cgi?id=248329
+
+Index: local/snmpconf
+===================================================================
+--- local/snmpconf.orig 2005-08-16 17:59:16.000000000 +0200
++++ local/snmpconf 2008-10-24 15:31:06.798387241 +0200
+@@ -682,6 +682,7 @@ sub output_files {
+ }
+ }
+ close(O);
++ system("restorecon $outputf");
+ }
+ }
+
|
[-]
[+]
|
Added |
net-snmp-5.4.2_testing.empty_arptable.patch
^
|
@@ -0,0 +1,99 @@
+Index: testing/rfc1213/snmpfun.sh
+===================================================================
+--- testing/rfc1213/snmpfun.sh.orig 2004-12-10 16:15:52.000000000 +0100
++++ testing/rfc1213/snmpfun.sh 2008-10-24 15:30:46.066386937 +0200
+@@ -1,4 +1,3 @@
+-
+ # functions used by RFC-1213 MIB test modules
+
+ myport=$SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT
+@@ -11,6 +10,23 @@ else
+ TEST_AUTHPRIV_PARMS="-l authNoPriv -a MD5 -A testpass"
+ fi
+
++check_skip_arp_tests ()
++{
++ #
++ # skip all tests relying on a filed arp table. e.g. on s390 boxes this
++ # does not have to be the case
++ #
++ TABLE_ENTRIES="at.atTable ip.ipNetToMediaTable"
++ ARP_COUNT=`/sbin/arp | grep -v incomplete | wc -l`
++ for entry in $TABLE_ENTRIES ; do
++ if [ "x$1" == "x$entry" -a $ARP_COUNT == 0 ] ; then
++ echo "skipping $1, because the arp table is empty." >&2
++ return 0
++ fi
++ done
++ return 1
++}
++
+ config()
+ {
+ rm -f $SNMP_CONFIG_FILE
+@@ -54,25 +70,35 @@ get_snmpv3_variable()
+ get_snmp_table()
+ {
+ test_start "Access table $2 by SNMPv$1..."
+- CAPTURE "snmpgetnext -Of -v $1 -c test $myport $2"
+- CHECKFILE '' "\.$2\."
+- if [ "$snmp_last_test_result" = 0 ] ; then
+- test_finish FAIL
++ check_skip_arp_tests
++ if check_skip_arp_tests "$2" ; then
++ test_finish SKIPPED
+ else
+- test_finish PASS
++ CAPTURE "snmpgetnext -Of -v $1 -c test $myport $2"
++ CHECKFILE '' "\.$2\."
++ if [ "$snmp_last_test_result" = 0 ] ; then
++ test_finish FAIL
++ else
++ test_finish PASS
++ fi
+ fi
+
+ }
+
+ get_snmpv3_table()
+ {
+- test_start "Access table $2 by SNMPv3..."
+- CAPTURE "snmpgetnext -Of -v 3 -u testrwuser $TEST_AUTHPRIV_PARMS $myport $2"
+- CHECKFILE '' "\.$2\."
+- if [ "$snmp_last_test_result" = 0 ] ; then
+- test_finish FAIL
++ test_start "Access table $2 by SNMPv3..."
++ if check_skip_arp_tests "$2" ; then
++ test_finish SKIPPED
+ else
+- test_finish PASS
++ CAPTURE "snmpgetnext -Of -v 3 -u testrwuser $TEST_AUTHPRIV_PARMS $myport $2"
++ CHECKFILE '' "\.$2\."
++ if [ "$snmp_last_test_result" = 0 ] ; then
++ test_finish FAIL
++ else
++ test_finish PASS
++ fi
+ fi
+
+ }
++
+Index: testing/rfc1213/test_fun
+===================================================================
+--- testing/rfc1213/test_fun.orig 2004-10-16 22:44:35.000000000 +0200
++++ testing/rfc1213/test_fun 2008-10-24 15:30:46.066386937 +0200
+@@ -51,6 +51,9 @@ test_finish()
+ if [ x$1 == x"PASS" ];then
+ pass_num=`expr $pass_num + 1`
+ pass_info "PASS\n"
++ elif [ x$1 == x"SKIPPED" ];then
++ pass_num=`expr $pass_num + 1`
++ pass_info "SKIPPED\n"
+ else
+ fail_num=`expr $fail_num + 1`
+ fail_info "FAIL\n"
+@@ -66,3 +69,4 @@ summary()
+ fi
+ }
+
++
|
[-]
[+]
|
Added |
net-snmp-5.4.2_velocity-mib.patch
^
|
@@ -0,0 +1,3373 @@
+Index: LICENSE.VELOCITY
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ LICENSE.VELOCITY 2008-10-24 15:34:16.302888835 +0200
+@@ -0,0 +1,41 @@
++/* Portions of these files are subject to the following copyright(s). See
++ * the Net-SNMP's COPYING file for more details and other copyrights
++ * that may apply:
++ */
++/*
++ * Portions of these files are copyrighted by:
++ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms specified in the COPYING file
++ * distributed with the Net-SNMP package.
++ */
++/*
++ * Copyright © 2002-2008, Velocity Software, Inc.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are met:
++ *
++ ** Redistributions of source code must retain the above copyright notice,
++ * this list of conditions and the following disclaimer.
++ *
++ ** Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ *
++ ** Neither the name of the Velocity Software, Inc. nor the
++ * names of its contributors may be used to endorse or promote
++ * products derived from this software without specific prior written
++ * permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
++ * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
++ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
++ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
++ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
+Index: agent/mibgroup/velocity.h
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ agent/mibgroup/velocity.h 2008-10-24 15:34:16.322885644 +0200
+@@ -0,0 +1,28 @@
++/*
++ * Velocity 'wrapper' interface which is an extension of the host resources
++ * calls the per-group interfaces from 'hr_*.h' and 'velocity_*.h'
++ */
++
++ config_require(host/hr_system)
++ config_require(velocity/velocity_system)
++ config_require(host/hr_storage)
++ config_require(host/hr_device)
++ config_require(host/hr_other)
++ config_require(host/hr_proc)
++ config_require(host/hr_network)
++ config_require(host/hr_print)
++ config_require(host/hr_disk)
++ config_require(host/hr_partition)
++ config_require(host/hr_filesys)
++ config_require(velocity/velocity_swrun)
++ config_require(host/hr_swrun)
++ config_require(host/hr_swinst)
++ config_require(velocity/velocity_app)
++/* config_require(ucd-snmp/proc) */
++
++/* add the host resources mib to the default mibs to load */
++config_add_mib(HOST-RESOURCES-MIB)
++config_add_mib(HOST-RESOURCES-TYPES)
++config_add_mib(UCD-SNMP-MIB)
++config_add_mib(VELOCITY-MIB)
++config_add_mib(VELOCITY-TYPES)
+Index: agent/mibgroup/velocity/velocity_app.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ agent/mibgroup/velocity/velocity_app.c 2008-10-24 15:34:16.406884701 +0200
+@@ -0,0 +1,499 @@
++#include <net-snmp/net-snmp-config.h>
++
++#ifdef solaris2
++#define _KMEMUSER /* Needed by <sys/user.h> */
++#include <sys/types.h> /* helps define struct rlimit */
++#endif
++
++#if HAVE_IO_H /* win32 */
++#include <io.h>
++#endif
++#if HAVE_STDLIB_H
++#include <stdlib.h>
++#endif
++#if HAVE_UNISTD_H
++#include <unistd.h>
++#endif
++#if HAVE_STRING_H
++#include <string.h>
++#else
++#include <strings.h>
++#endif
++#if HAVE_MALLOC_H
++#include <malloc.h>
++#endif
++#include <math.h>
++#include <ctype.h>
++#include <sys/types.h>
++#if HAVE_NETINET_IN_H
++#include <netinet/in.h>
++#endif
++#if TIME_WITH_SYS_TIME
++# ifdef WIN32
++# include <sys/timeb.h>
++# else
++# include <sys/time.h>
++# endif
++# include <time.h>
++#else
++# if HAVE_SYS_TIME_H
++# include <sys/time.h>
++# else
++# include <time.h>
++# endif
++#endif
++#if HAVE_KVM_H
++#include <kvm.h>
++#endif
++#if HAVE_WINSOCK_H
++#include <winsock.h>
++#endif
++
++#if HAVE_DMALLOC_H
++#include <dmalloc.h>
++#endif
++
++#include <net-snmp/net-snmp-includes.h>
++#include <net-snmp/agent/net-snmp-agent-includes.h>
++
++#include "struct.h"
++#include "velocity_app.h"
++#ifdef USING_UCD_SNMP_ERRORMIB_MODULE
++#include "../ucd-snmp/errormib.h"
++#else
++#define setPerrorstatus(x) snmp_log_perror(x)
++#endif
++#include "util_funcs.h"
++#include "kernel.h"
++#include "errno.h"
++
++static struct myvelocityApp *get_velocityApp_instance(struct myvelocityApp *, oid);
++struct myvelocityApp *velocityAppwatch = NULL;
++int numvelocityApps = 0;
++#define ID_SIZE 300
++
++void
++init_velocity_app(void)
++{
++
++ /*
++ * define the structure we're going to ask the agent to register our
++ * information at
++ */
++ struct variable2 extensible_velocityApp_variables[] = {
++ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_velocityApp, 1, {MIBINDEX}},
++ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_velocityApp, 1,
++ {ERRORNAME}},
++ {APPPID, ASN_OCTET_STR, RONLY, var_extensible_velocityApp, 1, {APPPID}},
++ {APPMIN, ASN_INTEGER, RONLY, var_extensible_velocityApp, 1, {APPMIN}},
++ {APPMAX, ASN_INTEGER, RONLY, var_extensible_velocityApp, 1, {APPMAX}},
++ {APPCOUNT, ASN_INTEGER, RONLY, var_extensible_velocityApp, 1,
++ {APPCOUNT}},
++ {APPIDS, ASN_OCTET_STR, RONLY, var_extensible_velocityApp, 1,
++ {APPIDS}},
++ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_velocityApp, 1,
++ {ERRORFLAG}},
++ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_velocityApp, 1,
++ {ERRORMSG}},
++ };
++
++ /*
++ * Define the OID pointer to the top of the mib tree that we're
++ * registering underneath
++ */
++ oid velocityApp_variables_oid[] = { 1, 3, 6, 1, 4, 1, 15601, 6, 1 };
++
++ /*
++ * register ourselves with the agent to handle our mib tree
++ */
++ REGISTER_MIB("velocity/velocity_app", extensible_velocityApp_variables, variable2,
++ velocityApp_variables_oid);
++
++ snmpd_register_config_handler("app", velocityApp_parse_config,
++ velocityApp_free_config,
++ "application-name [max-num] [min-num]");
++}
|
[-]
[+]
|
Added |
net-snmp-5.4.2_vendorperl.patch
^
|
@@ -0,0 +1,13 @@
+Index: Makefile.in
+===================================================================
+--- Makefile.in.orig 2007-06-08 22:32:56.000000000 +0200
++++ Makefile.in 2008-10-24 15:30:52.442885040 +0200
+@@ -169,7 +169,7 @@ perlmakefiles: net-snmp-config-x
+ fi
+
+ perlinstall:
+- @(cd perl ; $(MAKE) install) ; \
++ @(cd perl ; $(MAKE) install_vendor) ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi
|
[-]
[+]
|
Added |
net-snmp-5.4.rc2-versinfo.diff
^
|
@@ -0,0 +1,15 @@
+Index: agent/mibgroup/ucd-snmp/versioninfo.c
+===================================================================
+--- agent/mibgroup/ucd-snmp/versioninfo.c.orig
++++ agent/mibgroup/ucd-snmp/versioninfo.c
+@@ -130,8 +130,8 @@ var_extensible_version(struct variable *
+ case VERCONFIG:
+ #ifdef NETSNMP_CONFIGURE_OPTIONS
+ *var_len = strlen(config_opts);
+- if (*var_len > 1024)
+- *var_len = 1024; /* mib imposed restriction */
++ if (*var_len > 300)
++ *var_len = 300; /* mib imposed restriction */
+ return (u_char *) config_opts;
+ #else
+ sprintf(errmsg, "");
|
[-]
[+]
|
Added |
net-snmp-5.4.x_embedded_perl_error_message.patch
^
|
@@ -0,0 +1,13 @@
+=== agent/snmp_perl.c
+==================================================================
+--- agent/snmp_perl.c (revision 17294)
++++ agent/snmp_perl.c (local)
+@@ -58,7 +58,7 @@
+ return;
+
+ bail_out:
+- snmp_log(LOG_ERR, "embedded perl support failed to initalize\n");
++ snmp_log(LOG_ERR, "embedded perl support failed to initialize\n");
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISABLE_PERL, 1);
+ return;
|
[-]
[+]
|
Deleted |
net-snmp-5.4_default_store_return_value.patch
^
|
@@ -1,22 +0,0 @@
-Index: perl/agent/default_store/default_store.xs
-===================================================================
---- perl/agent/default_store/default_store.xs.orig
-+++ perl/agent/default_store/default_store.xs
-@@ -118,14 +118,16 @@ constant(char *name, int len, int arg)
- goto not_there;
- #endif
- }
-+/*
- case 'H':
-- if (strEQ(name + 0, "NETSNMP_DS_AGENT_H")) { /* removed */
-+ if (strEQ(name + 0, "NETSNMP_DS_AGENT_H")) { / * removed * /
- #ifdef NETSNMP_DS_AGENT_H
- return NETSNMP_DS_AGENT_H;
- #else
- goto not_there;
- #endif
- }
-+*/
- case 'I':
- if (strEQ(name + 0, "NETSNMP_DS_AGENT_INTERNAL_SECNAME")) { /* removed */
- #ifdef NETSNMP_DS_AGENT_INTERNAL_SECNAME
|
[-]
[+]
|
Deleted |
oid-names2_5.3.patch
^
|
@@ -1,28 +0,0 @@
-Index: snmplib/mib.c
-===================================================================
-RCS file: /cvsroot/net-snmp/net-snmp/snmplib/mib.c,v
-retrieving revision 5.89
-diff -u -p -r5.89 mib.c
---- snmplib/mib.c 2 Dec 2005 10:33:57 -0000 5.89
-+++ snmplib/mib.c 2 Feb 2006 14:20:38 -0000
-@@ -2861,7 +2861,7 @@ int
- read_objid(const char *input, oid * output, size_t * out_len)
- { /* number of subid's in "output" */
- #ifndef DISABLE_MIB_LOADING
-- struct tree *root = tree_head;
-+ struct tree *root = tree_top;
- #endif /* DISABLE_MIB_LOADING */
- char buf[SPRINT_MAX_LEN];
- int ret, max_out_len;
-@@ -2904,7 +2904,10 @@ read_objid(const char *input, oid * outp
- #endif /* DISABLE_MIB_LOADING */
-
- #ifndef DISABLE_MIB_LOADING
-- if (root == NULL) {
-+ if ((root == NULL) && (tree_head != NULL)) {
-+ root = tree_head;
-+ }
-+ else if (root == NULL) {
- SET_SNMP_ERROR(SNMPERR_NOMIB);
- *out_len = 0;
- return 0;
|
[-]
[+]
|
Added |
baselibs.conf
^
|
@@ -0,0 +1,5 @@
+libsnmp15
+arch ppc package net-snmp-devel
+ requires -net-snmp-<targettype>
+ requires "libsnmp15-<targettype> = <version>"
+
|
|
Changed |
net-snmp-5.4.2.1.tar.bz2
^
|
[-]
[+]
|
Added |
net-snmp-rpmlintrc
^
|
@@ -0,0 +1,3 @@
+addFilter("net-snmp-devel.* files-duplicate.*man.*")
+addFilter("net-snmp.*incoherent-init-script-name")
+addFilter("perl-SNMP.* zero-length.*\.bs")
|
[-]
[+]
|
Changed |
net-snmp.logrotate
^
|
@@ -10,6 +10,9 @@
sharedscripts
postrotate
/etc/init.d/snmpd try-restart ||:
+ if [ -x /etc/init.d/snmptrapd ] ; then \
+ /etc/init.d/snmptrapd try-restart ||: ; \
+ fi
endscript
}
|
[-]
[+]
|
Changed |
rc.net-snmp
^
|
@@ -7,11 +7,14 @@
#
### BEGIN INIT INFO
# Provides: net-snmp snmp
-# Required-Start: $network
-# Required-Stop:
+# Required-Start: $remote_fs
+# Should-Start: $syslog $network
+# Required-Stop: $remote_fs
+# Should-Stop: $syslog $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
-# Description: start net-snmpd
+# Description: Net-SNMP snmpd
+# Short-Description: Net-SNMP snmpd
### END INIT INFO
SNMPD=/usr/sbin/snmpd
@@ -78,7 +81,7 @@
# do not even try to start if the log file is (2GB-1MB) big.
# the snmpd doesnt handle LFS properly
#
- SNMPD_LOGFILE="/var/log/net-snmpd.log"
+ SNMPD_LOGFILE="${SNMPD_LOGFILE:-/var/log/net-snmpd.log}"
if [ -e "$SNMPD_LOGFILE" ] ; then
SNMPD_SIZE_LOGFILE="$(stat -c "%s" $SNMPD_LOGFILE)"
SNMPD_SIZE_MAX="1073741824"
@@ -109,7 +112,7 @@
rc_reset
# start all agents
- if test -n $agents; then
+ if test -n "$agents"; then
usleep 300000
for agent in $agents; do
echo -en "\tStarting `basename $agent`"
@@ -123,7 +126,7 @@
killproc -TERM $SNMPD
rc_status -v ; rc_reset
# we also need to make sure all agents die
- if test -n $agents; then
+ if test -n "$agents"; then
for agent in $AGENTDIR/*; do
test -x $agent || continue
echo -ne "\tShutting down `basename $agent`:"
|
[-]
[+]
|
Changed |
rc.snmptrapd
^
|
@@ -8,7 +8,7 @@
### BEGIN INIT INFO
# Provides: snmpdtrapd
# Required-Start: $network
-# Required-Stop:
+# Required-Stop: $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: start net-snmptrapd
|
|
Added |
ready
^
|