This commit is contained in:
parent
acb23d6792
commit
ae447f2050
3568
Add-Default-Router-Table-support.patch
Normal file
3568
Add-Default-Router-Table-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
1477
Add-ICMP-Statistics-Tables-support.patch
Normal file
1477
Add-ICMP-Statistics-Tables-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
3481
Add-IPv6-Scope-Zone-Index.patch
Normal file
3481
Add-IPv6-Scope-Zone-Index.patch
Normal file
File diff suppressed because it is too large
Load Diff
334
Add-IPv6-support-on-Internet-Address-Translation-Tab.patch
Normal file
334
Add-IPv6-support-on-Internet-Address-Translation-Tab.patch
Normal file
@ -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;
|
||||
+
|
||||
+ rtmp = (struct ndmsg *)NLMSG_DATA(nlmp);
|
||||
+ if (nlmp->nlmsg_type != RTM_NEWNEIGH && nlmp->nlmsg_type != RTM_DELNEIGH)
|
||||
+ return -1;
|
||||
+
|
||||
+ if(rtmp->ndm_state != NUD_NOARP) {
|
||||
+ memset(tb, 0, sizeof(struct rtattr *) * (NDA_MAX + 1));
|
||||
+ length = nlmp->nlmsg_len - NLMSG_LENGTH(sizeof(*rtmp));
|
||||
+ /* this is what the kernel-removed NDA_RTA define did */
|
||||
+ rta = ((struct rtattr*)(((char*)(rtmp)) +
|
||||
+ NLMSG_ALIGN(sizeof(struct ndmsg))));
|
||||
+ while (RTA_OK(rta, length)) {
|
||||
+ if (rta->rta_type <= NDA_MAX)
|
||||
+ tb[rta->rta_type] = rta;
|
||||
+ rta = RTA_NEXT(rta,length);
|
||||
+ }
|
||||
+ if(length)
|
||||
+ return -1;
|
||||
+ /* Fill up the index
|
||||
+ */
|
||||
+ entry->if_index = rtmp->ndm_ifindex;
|
||||
+ /* Fill up ip address */
|
||||
+ if (tb[NDA_DST]) {
|
||||
+ memset(&addr, '\0', sizeof(addr));
|
||||
+ in6p = (struct in6_addr *)RTA_DATA(tb[NDA_DST]);
|
||||
+ sprintf(addr, NIP6_FMT, NIP6(*in6p));
|
||||
+ in_len = entry->arp_ipaddress_len = sizeof(entry->arp_ipaddress);
|
||||
+ netsnmp_assert(16 == in_len);
|
||||
+ out_len = 0;
|
||||
+ buf = entry->arp_ipaddress;
|
||||
+ if(1 != netsnmp_hex_to_binary(&buf, &in_len,
|
||||
+ &out_len, 0, addr, ":")) {
|
||||
+ snmp_log(LOG_ERR,"error parsing '%s', skipping\n",
|
||||
+ entry->arp_ipaddress);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ netsnmp_assert(16 == out_len);
|
||||
+ entry->arp_ipaddress_len = out_len;
|
||||
+ }
|
||||
+ if (tb[NDA_LLADDR]) {
|
||||
+ memset(&addr, '\0', sizeof(addr));
|
||||
+ hwaddr = RTA_DATA(tb[NDA_LLADDR]);
|
||||
+ entry->arp_physaddress_len = RTA_PAYLOAD(tb[NDA_LLADDR]);
|
||||
+ buf = entry->arp_physaddress;
|
||||
+ for (i = 0; i < entry->arp_physaddress_len; i++)
|
||||
+ entry->arp_physaddress[i] = hwaddr[i];
|
||||
+ }
|
||||
+
|
||||
+ switch (rtmp->ndm_state) {
|
||||
+ case NUD_INCOMPLETE:
|
||||
+ entry->arp_state = INETNETTOMEDIASTATE_INCOMPLETE;
|
||||
+ break;
|
||||
+ case NUD_REACHABLE:
|
||||
+ case NUD_PERMANENT:
|
||||
+ entry->arp_state = INETNETTOMEDIASTATE_REACHABLE;
|
||||
+ break;
|
||||
+ case NUD_STALE:
|
||||
+ entry->arp_state = INETNETTOMEDIASTATE_STALE;
|
||||
+ break;
|
||||
+ case NUD_DELAY:
|
||||
+ entry->arp_state = INETNETTOMEDIASTATE_DELAY;
|
||||
+ break;
|
||||
+ case NUD_PROBE:
|
||||
+ entry->arp_state = INETNETTOMEDIASTATE_PROBE;
|
||||
+ break;
|
||||
+ case NUD_FAILED:
|
||||
+ entry->arp_state = INETNETTOMEDIASTATE_INVALID;
|
||||
+ break;
|
||||
+ case NUD_NONE:
|
||||
+ entry->arp_state = INETNETTOMEDIASTATE_UNKNOWN;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ switch (rtmp->ndm_state) {
|
||||
+ case NUD_INCOMPLETE:
|
||||
+ case NUD_FAILED :
|
||||
+ case NUD_NONE :
|
||||
+ entry->arp_type = INETNETTOMEDIATYPE_INVALID;
|
||||
+ break;
|
||||
+ case NUD_REACHABLE:
|
||||
+ case NUD_STALE :
|
||||
+ case NUD_DELAY :
|
||||
+ case NUD_PROBE :
|
||||
+ entry->arp_type = INETNETTOMEDIATYPE_DYNAMIC;
|
||||
+ break;
|
||||
+ case NUD_PERMANENT:
|
||||
+ entry->arp_type = INETNETTOMEDIATYPE_STATIC;
|
||||
+ break;
|
||||
+ default:
|
||||
+ entry->arp_type = INETNETTOMEDIATYPE_LOCAL;
|
||||
+ break;
|
||||
+ }
|
||||
+ } else {
|
||||
+ return -1; /* could not create data for this interface */
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
+#endif
|
||||
diff --git a/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
|
||||
index cad942c..dcc7900 100644
|
||||
--- a/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
|
||||
+++ b/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
|
||||
@@ -155,7 +155,7 @@ _snarf_arp_entry(netsnmp_arp_entry *arp_entry,
|
||||
inetAddressType = INETADDRESSTYPE_IPV4;
|
||||
break;
|
||||
|
||||
- case 6:
|
||||
+ case 16:
|
||||
inetAddressType = INETADDRESSTYPE_IPV6;
|
||||
break;
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index c5e05ba..220506a 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -3365,6 +3365,16 @@ AC_CHECK_HEADERS(linux/rtnetlink.h,,,
|
||||
#include <linux/netlink.h>
|
||||
#endif
|
||||
]])
|
||||
+# linux rtnetlink
|
||||
+AC_CHECK_HEADERS(linux/rtnetlink.h,,,
|
||||
+[[
|
||||
+#if HAVE_ASM_TYPES_H
|
||||
+#include <asm/types.h>
|
||||
+#endif
|
||||
+#if HAVE_SYS_SOCKET_H
|
||||
+#include <sys/socket.h>
|
||||
+#endif
|
||||
+]])
|
||||
# BSDi3 headers
|
||||
AC_CHECK_HEADERS(sys/stat.h)
|
||||
# BSDi3/IRIX headers
|
||||
--
|
||||
1.6.0.2
|
||||
|
69
Fix-for-IPv6-Interface-Table.patch
Normal file
69
Fix-for-IPv6-Interface-Table.patch
Normal file
@ -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
|
||||
|
876
Fix-for-Internet-Address-Prefix-Table.patch
Normal file
876
Fix-for-Internet-Address-Prefix-Table.patch
Normal file
@ -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;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if(nlmp->nlmsg_type == RTM_NEWPREFIX) {
|
||||
+ prefix = NLMSG_DATA(nlmp);
|
||||
+ length = nlmp->nlmsg_len;
|
||||
+ length -= NLMSG_LENGTH(sizeof(*prefix));
|
||||
+
|
||||
+ if (length < 0) {
|
||||
+ DEBUGMSGTL(("access:interface:prefix", "wrong nlmsg length %d\n", length));
|
||||
+ continue;
|
||||
+ }
|
||||
+ flag2 = 1;
|
||||
+ if (prefix->prefix_flags & IF_PREFIX_ONLINK)
|
||||
+ onlink = 1;
|
||||
+ if (prefix->prefix_flags & IF_PREFIX_AUTOCONF)
|
||||
+ autonomous = 1;
|
||||
+ }
|
||||
+ status -= NLMSG_ALIGN(len);
|
||||
+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len));
|
||||
+ }
|
||||
+ if((flag1 == 1) && (flag2 == 1)){
|
||||
+ if(!(new = net_snmp_create_prefix_info (onlink, autonomous, in6pAddr)))
|
||||
+ DEBUGMSGTL(("access:interface:prefix", "Unable to create prefix info\n"));
|
||||
+ else {
|
||||
+ iret = net_snmp_update_prefix_info (listen_info->list_head, new, listen_info->lockinfo);
|
||||
+ if(iret < 0) {
|
||||
+ DEBUGMSGTL(("access:interface:prefix", "Unable to add/update prefix info\n"));
|
||||
+ free(new);
|
||||
+ }
|
||||
+ if(iret == 2) /*Only when enrty already exists and we are only updating*/
|
||||
+ free(new);
|
||||
+ }
|
||||
+ flag1 = flag2 = 0;
|
||||
+ onlink = autonomous = 2; /*Set to defaults again*/
|
||||
+ } else if (flag1 == -1) {
|
||||
+ iret = net_snmp_delete_prefix_info (listen_info->list_head, in6pAddr, listen_info->lockinfo);
|
||||
+ if(iret < 0)
|
||||
+ DEBUGMSGTL(("access:interface:prefix", "Unable to delete the prefix info\n"));
|
||||
+ if(!iret)
|
||||
+ DEBUGMSGTL(("access:interface:prefix", "Unable to find the node to delete\n"));
|
||||
+ flag1 = 0;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
|
||||
index 396fc96..3eef0cc 100644
|
||||
--- a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
|
||||
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
|
||||
@@ -304,6 +304,27 @@ netsnmp_access_ipaddress_entry_update(netsnmp_ipaddress_entry *lhs,
|
||||
++changed;
|
||||
lhs->ia_origin = rhs->ia_origin;
|
||||
}
|
||||
+
|
||||
+ if (lhs->ia_onlink_flag != rhs->ia_onlink_flag) {
|
||||
+ ++changed;
|
||||
+ lhs->ia_onlink_flag = rhs->ia_onlink_flag;
|
||||
+ }
|
||||
+
|
||||
+ if (lhs->ia_autonomous_flag != rhs->ia_autonomous_flag) {
|
||||
+ ++changed;
|
||||
+ lhs->ia_autonomous_flag = rhs->ia_autonomous_flag;
|
||||
+ }
|
||||
+
|
||||
+ if (lhs->ia_prefered_lifetime != rhs->ia_prefered_lifetime) {
|
||||
+ ++changed;
|
||||
+ lhs->ia_prefered_lifetime = rhs->ia_prefered_lifetime;
|
||||
+ }
|
||||
+
|
||||
+ if (lhs->ia_valid_lifetime != rhs->ia_valid_lifetime) {
|
||||
+ ++changed;
|
||||
+ lhs->ia_valid_lifetime = rhs->ia_valid_lifetime;
|
||||
+ }
|
||||
+
|
||||
|
||||
return changed;
|
||||
}
|
||||
@@ -428,3 +449,49 @@ static int _access_ipaddress_entry_compare_addr(const void *lhs,
|
||||
*/
|
||||
return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
|
||||
}
|
||||
+
|
||||
+int
|
||||
+netsnmp_ipaddress_flags_copy(u_long *ipAddressPrefixAdvPreferredLifetime,
|
||||
+ u_long *ipAddressPrefixAdvValidLifetime,
|
||||
+ u_long *ipAddressPrefixOnLinkFlag,
|
||||
+ u_long *ipAddressPrefixAutonomousFlag,
|
||||
+ u_long *ia_prefered_lifetime,
|
||||
+ u_long *ia_valid_lifetime,
|
||||
+ u_char *ia_onlink_flag,
|
||||
+ u_char *ia_autonomous_flag)
|
||||
+{
|
||||
+
|
||||
+ /*Copy all the flags*/
|
||||
+ *ipAddressPrefixAdvPreferredLifetime = *ia_prefered_lifetime;
|
||||
+ *ipAddressPrefixAdvValidLifetime = *ia_valid_lifetime;
|
||||
+ *ipAddressPrefixOnLinkFlag = *ia_onlink_flag;
|
||||
+ *ipAddressPrefixAutonomousFlag = *ia_autonomous_flag;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+netsnmp_ipaddress_prefix_origin_copy(u_long *ipAddressPrefixOrigin,
|
||||
+ u_char ia_origin,
|
||||
+ int flags,
|
||||
+ u_long ipAddressAddrType)
|
||||
+{
|
||||
+ if(ipAddressAddrType == INETADDRESSTYPE_IPV4){
|
||||
+ if(ia_origin == 6) /*Random*/
|
||||
+ (*ipAddressPrefixOrigin) = 3 /*IPADDRESSPREFIXORIGINTC_WELLKNOWN*/;
|
||||
+ else
|
||||
+ (*ipAddressPrefixOrigin) = ia_origin;
|
||||
+ } else {
|
||||
+ if(ia_origin == 5) { /*Link Layer*/
|
||||
+ if(!flags) /*Global address assigned by router adv*/
|
||||
+ (*ipAddressPrefixOrigin) = 5 /*IPADDRESSPREFIXORIGINTC_ROUTERADV*/;
|
||||
+ else
|
||||
+ (*ipAddressPrefixOrigin) = 3 /*IPADDRESSPREFIXORIGINTC_WELLKNOWN*/;
|
||||
+ }
|
||||
+ else if(ia_origin == 6) /*Random*/
|
||||
+ (*ipAddressPrefixOrigin) = 5 /*IPADDRESSPREFIXORIGINTC_ROUTERADV*/;
|
||||
+ else
|
||||
+ (*ipAddressPrefixOrigin) = ia_origin;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
|
||||
index 4616649..c6e5fec 100644
|
||||
--- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
|
||||
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <net-snmp/data_access/interface.h>
|
||||
|
||||
#include "ip-mib/ipAddressTable/ipAddressTable_constants.h"
|
||||
+#include "ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h"
|
||||
+#include "mibgroup/util_funcs.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
@@ -19,15 +21,29 @@
|
||||
#if defined (NETSNMP_ENABLE_IPV6)
|
||||
#include <linux/types.h>
|
||||
#include <asm/types.h>
|
||||
-#ifdef HAVE_LINUX_RTNETLINK_H
|
||||
+#if defined(HAVE_PTHREAD_H) && defined(HAVE_LINUX_RTNETLINK_H)
|
||||
#include <linux/netlink.h>
|
||||
+#include <pthread.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
-#endif
|
||||
+#ifdef RTMGRP_IPV6_PREFIX
|
||||
+#define SUPPORT_PREFIX_FLAGS 1
|
||||
+#endif /* RTMGRP_IPV6_PREFIX */
|
||||
+#endif /* HAVE_PTHREAD_H && HAVE_LINUX_RTNETLINK_H */
|
||||
#endif
|
||||
|
||||
#include "ipaddress_ioctl.h"
|
||||
-
|
||||
+#ifdef SUPPORT_PREFIX_FLAGS
|
||||
+extern prefix_cbx *prefix_head_list;
|
||||
+extern pthread_mutex_t prefix_mutex_lock;
|
||||
+#endif
|
||||
int _load_v6(netsnmp_container *container, int idx_offset);
|
||||
+#ifdef HAVE_LINUX_RTNETLINK_H
|
||||
+int
|
||||
+netsnmp_access_ipaddress_extra_prefix_info(int index,
|
||||
+ u_long *preferedlt,
|
||||
+ ulong *validlt,
|
||||
+ char *addr);
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* initialize arch specific storage
|
||||
@@ -194,6 +210,7 @@ _load_v6(netsnmp_container *container, int idx_offset)
|
||||
u_char *buf;
|
||||
int if_index, pfx_len, scope, flags, rc = 0;
|
||||
size_t in_len, out_len;
|
||||
+ prefix_cbx prefix_val;
|
||||
netsnmp_ipaddress_entry *entry;
|
||||
_ioctl_extras *extras;
|
||||
static int log_open_err = 1;
|
||||
@@ -251,6 +268,7 @@ _load_v6(netsnmp_container *container, int idx_offset)
|
||||
in_len = entry->ia_address_len = sizeof(entry->ia_address);
|
||||
netsnmp_assert(16 == in_len);
|
||||
out_len = 0;
|
||||
+ entry->flags = flags;
|
||||
buf = entry->ia_address;
|
||||
if(1 != netsnmp_hex_to_binary(&buf, &in_len,
|
||||
&out_len, 0, addr, ":")) {
|
||||
@@ -341,6 +359,30 @@ _load_v6(netsnmp_container *container, int idx_offset)
|
||||
entry->ia_storagetype = STORAGETYPE_PERMANENT;
|
||||
|
||||
/* xxx-rks: what can we do with scope? */
|
||||
+#ifdef HAVE_LINUX_RTNETLINK_H
|
||||
+ if(netsnmp_access_ipaddress_extra_prefix_info(entry->if_index, &entry->ia_prefered_lifetime
|
||||
+ ,&entry->ia_valid_lifetime, addr) < 0){
|
||||
+ DEBUGMSGTL(("access:ipaddress:container", "unable to fetch extra prefix info\n"));
|
||||
+ }
|
||||
+#else
|
||||
+ entry->ia_prefered_lifetime = 0;
|
||||
+ entry->ia_valid_lifetime = 0;
|
||||
+#endif
|
||||
+#ifdef SUPPORT_PREFIX_FLAGS
|
||||
+ memset(&prefix_val, 0, sizeof(prefix_cbx));
|
||||
+ if(net_snmp_find_prefix_info(&prefix_head_list, addr, &prefix_val, &prefix_mutex_lock) < 0) {
|
||||
+ DEBUGMSGTL(("access:ipaddress:container", "unable to find info\n"));
|
||||
+ entry->ia_onlink_flag = 1; /*Set by default as true*/
|
||||
+ entry->ia_autonomous_flag = 2; /*Set by default as false*/
|
||||
+
|
||||
+ } else {
|
||||
+ entry->ia_onlink_flag = prefix_val.ipAddressPrefixOnLinkFlag;
|
||||
+ entry->ia_autonomous_flag = prefix_val.ipAddressPrefixAutonomousFlag;
|
||||
+ }
|
||||
+#else
|
||||
+ entry->ia_onlink_flag = 1; /*Set by default as true*/
|
||||
+ entry->ia_autonomous_flag = 2; /*Set by default as false*/
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* add entry to container
|
||||
@@ -448,4 +490,100 @@ netsnmp_access_other_info_get(int index, int family)
|
||||
return addr;
|
||||
#endif
|
||||
}
|
||||
+
|
||||
+#ifdef HAVE_LINUX_RTNETLINK_H
|
||||
+int
|
||||
+netsnmp_access_ipaddress_extra_prefix_info(int index, u_long *preferedlt,
|
||||
+ ulong *validlt, char *addr)
|
||||
+{
|
||||
+
|
||||
+ struct {
|
||||
+ struct nlmsghdr nlhdr;
|
||||
+ struct ifaddrmsg ifaceinfo;
|
||||
+ char buf[1024];
|
||||
+ } req;
|
||||
+
|
||||
+ struct rtattr *rta;
|
||||
+ int status;
|
||||
+ char buf[16384];
|
||||
+ char tmpaddr[40];
|
||||
+ struct nlmsghdr *nlmp;
|
||||
+ struct ifaddrmsg *rtmp;
|
||||
+ struct rtattr *rtatp;
|
||||
+ struct ifa_cacheinfo *cache_info;
|
||||
+ struct in6_addr *in6p;
|
||||
+ int rtattrlen;
|
||||
+ int sd;
|
||||
+ int reqaddr = 0;
|
||||
+ sd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
|
||||
+ if(sd < 0) {
|
||||
+ snmp_log(LOG_ERR, "could not open netlink socket\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ memset(&req, 0, sizeof(req));
|
||||
+ req.nlhdr.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
|
||||
+ req.nlhdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT;
|
||||
+ req.nlhdr.nlmsg_type = RTM_GETADDR;
|
||||
+ req.ifaceinfo.ifa_family = AF_INET6;
|
||||
+ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.nlhdr.nlmsg_len));
|
||||
+ rta->rta_len = RTA_LENGTH(16); /*For ipv6*/
|
||||
+
|
||||
+ status = send (sd, &req, req.nlhdr.nlmsg_len, 0);
|
||||
+ if (status < 0) {
|
||||
+ snmp_log(LOG_ERR, "could not send netlink request\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ status = recv (sd, buf, sizeof(buf), 0);
|
||||
+ if (status < 0) {
|
||||
+ snmp_log (LOG_ERR, "could not recieve netlink request\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (status == 0) {
|
||||
+ snmp_log (LOG_ERR, "nothing to read\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ for (nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp); ){
|
||||
+
|
||||
+ int len = nlmp->nlmsg_len;
|
||||
+ int req_len = len - sizeof(*nlmp);
|
||||
+
|
||||
+ if (req_len < 0 || len > status) {
|
||||
+ snmp_log (LOG_ERR, "invalid netlink message\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (!NLMSG_OK (nlmp, status)) {
|
||||
+ snmp_log (LOG_ERR, "invalid NLMSG message\n");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ rtmp = (struct ifaddrmsg *)NLMSG_DATA(nlmp);
|
||||
+ rtatp = (struct rtattr *)IFA_RTA(rtmp);
|
||||
+ rtattrlen = IFA_PAYLOAD(nlmp);
|
||||
+ if(index == rtmp->ifa_index) {
|
||||
+ for (; RTA_OK(rtatp, rtattrlen); rtatp = RTA_NEXT(rtatp, rtattrlen)) {
|
||||
+ if(rtatp->rta_type == IFA_ADDRESS) {
|
||||
+ in6p = (struct in6_addr *)RTA_DATA(rtatp);
|
||||
+ sprintf(tmpaddr, "%04x%04x%04x%04x%04x%04x%04x%04x", NIP6(*in6p));
|
||||
+ if(!strcmp(tmpaddr ,addr))
|
||||
+ reqaddr = 1;
|
||||
+ }
|
||||
+ if(rtatp->rta_type == IFA_CACHEINFO) {
|
||||
+ cache_info = (struct ifa_cacheinfo *)RTA_DATA(rtatp);
|
||||
+ if(reqaddr) {
|
||||
+ reqaddr = 0;
|
||||
+ *validlt = cache_info->ifa_valid;
|
||||
+ *preferedlt = cache_info->ifa_prefered;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+ }
|
||||
+ status -= NLMSG_ALIGN(len);
|
||||
+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len));
|
||||
+ }
|
||||
+ close(sd);
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
#endif
|
||||
diff --git a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c
|
||||
index ecd26a0..9188f93 100644
|
||||
--- a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c
|
||||
+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c
|
||||
@@ -392,10 +392,9 @@ ipAddressPrefixOrigin_get(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
|
||||
* TODO:231:o: |-> Extract the current value of the ipAddressPrefixOrigin data.
|
||||
* copy (* ipAddressPrefixOrigin_val_ptr ) from rowreq_ctx->data
|
||||
*/
|
||||
- (*ipAddressPrefixOrigin_val_ptr) =
|
||||
- rowreq_ctx->data.ipAddressPrefixOrigin;
|
||||
-
|
||||
- return MFD_SUCCESS;
|
||||
+ (*ipAddressPrefixOrigin_val_ptr) = rowreq_ctx->data.ipAddressPrefixOrigin;
|
||||
+
|
||||
+ return MFD_SUCCESS;
|
||||
} /* ipAddressPrefixOrigin_get */
|
||||
|
||||
/*---------------------------------------------------------------------
|
||||
diff --git a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
|
||||
index d9c0cb0..6dd440d 100644
|
||||
--- a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
|
||||
+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
|
||||
@@ -137,3 +137,17 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
#endif /* IPADDRESSPREFIXTABLE_OIDS_H */
|
||||
+/****************************************************************
|
||||
+* Additional constants and definitions for common implementation
|
||||
+*/
|
||||
+#define INFINITY_LIFE_TIME 0xFFFFFFFFU
|
||||
+#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])
|
||||
+
|
||||
diff --git a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
|
||||
index 4cda4de..9e0b5fe 100644
|
||||
--- a/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
|
||||
+++ b/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
|
||||
@@ -251,6 +251,23 @@ ipAddressPrefixTable_container_load(netsnmp_container *container)
|
||||
ia_address_len,
|
||||
addr_rowreq_ctx->data->
|
||||
ia_prefix_len);
|
||||
+ netsnmp_ipaddress_flags_copy(&rowreq_ctx->data.
|
||||
+ ipAddressPrefixAdvPreferredLifetime,
|
||||
+ &rowreq_ctx->data.
|
||||
+ ipAddressPrefixAdvValidLifetime,
|
||||
+ &rowreq_ctx->data.
|
||||
+ ipAddressPrefixOnLinkFlag,
|
||||
+ &rowreq_ctx->data.
|
||||
+ ipAddressPrefixAutonomousFlag,
|
||||
+ &addr_rowreq_ctx->data->
|
||||
+ ia_prefered_lifetime,
|
||||
+ &addr_rowreq_ctx->data->
|
||||
+ ia_valid_lifetime,
|
||||
+ &addr_rowreq_ctx->data->
|
||||
+ ia_onlink_flag,
|
||||
+ &addr_rowreq_ctx->data->
|
||||
+ ia_autonomous_flag);
|
||||
+
|
||||
if (MFD_SUCCESS !=
|
||||
ipAddressPrefixTable_indexes_set(rowreq_ctx,
|
||||
addr_rowreq_ctx->data->
|
||||
@@ -277,8 +294,14 @@ ipAddressPrefixTable_container_load(netsnmp_container *container)
|
||||
* TODO:352:r: | |-> populate ipAddressPrefixTable data context.
|
||||
* Populate data context here. (optionally, delay until row prep)
|
||||
*/
|
||||
- rowreq_ctx->data.ipAddressPrefixOrigin =
|
||||
- addr_rowreq_ctx->data->ia_origin;
|
||||
+ netsnmp_ipaddress_prefix_origin_copy(&rowreq_ctx->data.
|
||||
+ ipAddressPrefixOrigin,
|
||||
+ addr_rowreq_ctx->data->
|
||||
+ ia_origin,
|
||||
+ addr_rowreq_ctx->data->
|
||||
+ flags,
|
||||
+ addr_rowreq_ctx->tbl_idx.
|
||||
+ ipAddressAddrType);
|
||||
|
||||
/** defer the rest til row prep */
|
||||
|
||||
diff --git a/agent/mibgroup/util_funcs.c b/agent/mibgroup/util_funcs.c
|
||||
index 26826f7..d060721 100644
|
||||
--- a/agent/mibgroup/util_funcs.c
|
||||
+++ b/agent/mibgroup/util_funcs.c
|
||||
@@ -100,7 +100,9 @@
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
#endif
|
||||
-
|
||||
+#ifdef HAVE_PTHREAD_H
|
||||
+#include <pthread.h>
|
||||
+#endif
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
||||
|
||||
@@ -1292,3 +1294,151 @@ get_pid_from_inode(unsigned long long inode)
|
||||
}
|
||||
|
||||
#endif /* #ifdef linux */
|
||||
+
|
||||
+#if defined(HAVE_PTHREAD_H)
|
||||
+prefix_cbx *net_snmp_create_prefix_info(unsigned long OnLinkFlag,
|
||||
+ unsigned long AutonomousFlag,
|
||||
+ char *in6ptr)
|
||||
+{
|
||||
+ prefix_cbx *node = SNMP_MALLOC_TYPEDEF(prefix_cbx);
|
||||
+ if(!in6ptr) {
|
||||
+ free(node);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ if(!node) {
|
||||
+ free(node);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ node->next_info = NULL;
|
||||
+ node->ipAddressPrefixOnLinkFlag = OnLinkFlag;
|
||||
+ node->ipAddressPrefixAutonomousFlag = AutonomousFlag;
|
||||
+ memcpy(node->in6p, in6ptr, sizeof(node->in6p));
|
||||
+
|
||||
+ return node;
|
||||
+}
|
||||
+
|
||||
+int net_snmp_find_prefix_info(prefix_cbx **head,
|
||||
+ char *address,
|
||||
+ prefix_cbx *node_to_find,
|
||||
+ pthread_mutex_t *lockid)
|
||||
+{
|
||||
+ int iret;
|
||||
+ memset(node_to_find, 0, sizeof(prefix_cbx));
|
||||
+ if(!*head)
|
||||
+ return -1;
|
||||
+ memcpy(node_to_find->in6p, address, sizeof(node_to_find->in6p));
|
||||
+
|
||||
+ iret = net_snmp_search_update_prefix_info(head, node_to_find, 1, lockid);
|
||||
+ if(iret < 0) {
|
||||
+ DEBUGMSGTL(("util_funcs:prefix", "Unable to search the list\n"));
|
||||
+ return -1;
|
||||
+ } else if (!iret) {
|
||||
+ DEBUGMSGTL(("util_funcs:prefix", "Could not find prefix info\n"));
|
||||
+ return -1;
|
||||
+ } else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int net_snmp_update_prefix_info(prefix_cbx **head,
|
||||
+ prefix_cbx *node_to_update,
|
||||
+ pthread_mutex_t *lockid)
|
||||
+{
|
||||
+ int iret;
|
||||
+ iret = net_snmp_search_update_prefix_info(head, node_to_update, 0, lockid);
|
||||
+ if(iret < 0) {
|
||||
+ DEBUGMSGTL(("util_funcs:prefix", "Unable to update prefix info\n"));
|
||||
+ return -1;
|
||||
+ } else if (!iret) {
|
||||
+ DEBUGMSGTL(("util_funcs:prefix", "Unable to find the node to update\n"));
|
||||
+ return -1;
|
||||
+ } else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int net_snmp_search_update_prefix_info(prefix_cbx **head,
|
||||
+ prefix_cbx *node_to_use,
|
||||
+ int functionality,
|
||||
+ pthread_mutex_t *lockid)
|
||||
+{
|
||||
+
|
||||
+ /* We define functionality based on need *
|
||||
+ * 0 - Need to do a search and update. We have to provide the node_to_use structure filled fully *
|
||||
+ * 1 - Need to do only search. Provide the node_to_use with in6p value filled */
|
||||
+
|
||||
+ prefix_cbx *temp_node;
|
||||
+ netsnmp_assert(NULL != head);
|
||||
+ netsnmp_assert(NULL != node_to_use);
|
||||
+
|
||||
+ if(functionality > 1)
|
||||
+ return -1;
|
||||
+ if(!node_to_use)
|
||||
+ return -1;
|
||||
+
|
||||
+
|
||||
+ if (!functionality) {
|
||||
+ if (!*head) {
|
||||
+ *head = node_to_use;
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ pthread_mutex_lock( lockid );
|
||||
+ for (temp_node = *head; temp_node->next_info != NULL ; temp_node = temp_node->next_info) {
|
||||
+ if (0 == strcmp(temp_node->in6p, node_to_use->in6p)) {
|
||||
+ temp_node->ipAddressPrefixOnLinkFlag = node_to_use->ipAddressPrefixOnLinkFlag;
|
||||
+ temp_node->ipAddressPrefixAutonomousFlag = node_to_use->ipAddressPrefixAutonomousFlag;
|
||||
+ pthread_mutex_unlock( lockid );
|
||||
+ return 2;
|
||||
+ }
|
||||
+ }
|
||||
+ temp_node->next_info = node_to_use;
|
||||
+ pthread_mutex_unlock( lockid );
|
||||
+ return 1;
|
||||
+ } else {
|
||||
+ pthread_mutex_lock( lockid );
|
||||
+ for (temp_node = *head; temp_node != NULL ; temp_node = temp_node->next_info) {
|
||||
+ if (0 == strcmp(temp_node->in6p, node_to_use->in6p)) {
|
||||
+ /*need yo put sem here as i read here */
|
||||
+ node_to_use->ipAddressPrefixOnLinkFlag = temp_node->ipAddressPrefixOnLinkFlag;
|
||||
+ node_to_use->ipAddressPrefixAutonomousFlag = temp_node->ipAddressPrefixAutonomousFlag;
|
||||
+ pthread_mutex_unlock( lockid );
|
||||
+ return 1;
|
||||
+ }
|
||||
+ }
|
||||
+ pthread_mutex_unlock( lockid );
|
||||
+ return 0;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int net_snmp_delete_prefix_info(prefix_cbx **head,
|
||||
+ char *address,
|
||||
+ pthread_mutex_t *lockid)
|
||||
+{
|
||||
+
|
||||
+ prefix_cbx *temp_node,*prev_node;
|
||||
+ if(!address)
|
||||
+ return -1;
|
||||
+ if(!head)
|
||||
+ return -1;
|
||||
+
|
||||
+ /*Need to acquire lock here */
|
||||
+ pthread_mutex_lock( lockid );
|
||||
+ for (temp_node = *head, prev_node = NULL; temp_node;
|
||||
+ prev_node = temp_node, temp_node = temp_node->next_info) {
|
||||
+
|
||||
+ if (temp_node->in6p && strcmp(temp_node->in6p, address) == 0) {
|
||||
+ if (prev_node)
|
||||
+ prev_node->next_info = temp_node->next_info;
|
||||
+ else
|
||||
+ *head = temp_node->next_info;
|
||||
+ free(temp_node);
|
||||
+ pthread_mutex_unlock( lockid );
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+ /*Release Lock here */
|
||||
+ pthread_mutex_unlock( lockid );
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
diff --git a/agent/mibgroup/util_funcs.h b/agent/mibgroup/util_funcs.h
|
||||
index 4a0b99e..aa4257f 100644
|
||||
--- a/agent/mibgroup/util_funcs.h
|
||||
+++ b/agent/mibgroup/util_funcs.h
|
||||
@@ -8,8 +8,23 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
+#ifdef HAVE_PTHREAD_H
|
||||
+#include <pthread.h>
|
||||
+#endif
|
||||
#include "struct.h"
|
||||
|
||||
+typedef struct prefix_info
|
||||
+{
|
||||
+ struct prefix_info *next_info;
|
||||
+ unsigned long ipAddressPrefixOnLinkFlag;
|
||||
+ unsigned long ipAddressPrefixAutonomousFlag;
|
||||
+ char in6p[40];
|
||||
+}prefix_cbx;
|
||||
+typedef struct
|
||||
+{
|
||||
+ prefix_cbx **list_head;
|
||||
+ pthread_mutex_t *lockinfo;
|
||||
+}netsnmp_prefix_listen_info;
|
||||
void Exit(int);
|
||||
int shell_command(struct extensible *);
|
||||
int exec_command(struct extensible *);
|
||||
@@ -37,6 +52,32 @@ const char *make_tempfile(void);
|
||||
#ifdef linux
|
||||
unsigned int get_pid_from_inode(unsigned long long);
|
||||
#endif
|
||||
+prefix_cbx *net_snmp_create_prefix_info(unsigned long OnLinkFlag,
|
||||
+ unsigned long AutonomousFlag,
|
||||
+ char *in6ptr);
|
||||
+int net_snmp_find_prefix_info(prefix_cbx **head,
|
||||
+ char *address,
|
||||
+ prefix_cbx *node_to_find,
|
||||
+ pthread_mutex_t *lockid);
|
||||
+int net_snmp_update_prefix_info(prefix_cbx **head,
|
||||
+ prefix_cbx *node_to_update,
|
||||
+ pthread_mutex_t *lockid);
|
||||
+int net_snmp_search_update_prefix_info(prefix_cbx **head,
|
||||
+ prefix_cbx *node_to_use,
|
||||
+ int functionality,
|
||||
+ pthread_mutex_t *lockid);
|
||||
+int net_snmp_delete_prefix_info(prefix_cbx **head,
|
||||
+ char *address,
|
||||
+ pthread_mutex_t *lockid);
|
||||
+#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 satosin(x) ((struct sockaddr_in *) &(x))
|
||||
#define SOCKADDR(x) (satosin(x)->sin_addr.s_addr)
|
||||
diff --git a/include/net-snmp/data_access/ipaddress.h b/include/net-snmp/data_access/ipaddress.h
|
||||
index b751b47..37083be 100644
|
||||
--- a/include/net-snmp/data_access/ipaddress.h
|
||||
+++ b/include/net-snmp/data_access/ipaddress.h
|
||||
@@ -47,7 +47,10 @@ typedef struct netsnmp_ipaddress_s {
|
||||
u_char ia_status; /* IpAddressStatus (1-7) */
|
||||
u_char ia_origin; /* IpAddressOrigin (1-6) */
|
||||
u_char ia_storagetype; /* IpAddressStorageType (1-5) */
|
||||
-
|
||||
+ u_char ia_onlink_flag; /* IpOnlinkFlag */
|
||||
+ u_char ia_autonomous_flag; /*IpAutonomousFlag */
|
||||
+ u_long ia_prefered_lifetime;/*IpPreferedLifeTime*/
|
||||
+ u_long ia_valid_lifetime;/*IpValidLifeTime*/
|
||||
netsnmp_data_list *arch_data; /* arch specific data */
|
||||
|
||||
} netsnmp_ipaddress_entry;
|
||||
@@ -142,7 +145,19 @@ int netsnmp_ipaddress_prefix_copy(u_char *dst, u_char *src,
|
||||
|
||||
int netsnmp_ipaddress_ipv4_prefix_len(in_addr_t mask);
|
||||
|
||||
-
|
||||
+int netsnmp_ipaddress_flags_copy(u_long *ipAddressPrefixAdvPreferredLifetime,
|
||||
+ u_long *ipAddressPrefixAdvValidLifetime,
|
||||
+ u_long *ipAddressPrefixOnLinkFlag,
|
||||
+ u_long *ipAddressPrefixAutonomousFlag,
|
||||
+ u_long *ia_prefered_lifetime,
|
||||
+ u_long *ia_valid_lifetime,
|
||||
+ u_char *ia_onlink_flag,
|
||||
+ u_char *ia_autonomous_flag);
|
||||
+
|
||||
+int netsnmp_ipaddress_prefix_origin_copy(u_long *ipAddressPrefixOrigin,
|
||||
+ u_char ia_origin,
|
||||
+ int flags,
|
||||
+ u_long ipAddressAddrType);
|
||||
|
||||
/**---------------------------------------------------------------------*/
|
||||
|
||||
--
|
||||
1.6.0.2
|
||||
|
405
Fix-for-Internet-Address-Table.patch
Normal file
405
Fix-for-Internet-Address-Table.patch
Normal file
@ -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;
|
||||
|
||||
netsnmp_assert(NULL != container);
|
||||
|
||||
@@ -268,6 +270,10 @@ _load_v6(netsnmp_container *container, int idx_offset)
|
||||
* every time it is called.
|
||||
*/
|
||||
entry->if_index = netsnmp_access_interface_index_find(if_name);
|
||||
+ 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_INET6);
|
||||
+#endif
|
||||
|
||||
/*
|
||||
#define IPADDRESSSTATUSTC_PREFERRED 1
|
||||
@@ -278,7 +284,7 @@ _load_v6(netsnmp_container *container, int idx_offset)
|
||||
#define IPADDRESSSTATUSTC_TENTATIVE 6
|
||||
#define IPADDRESSSTATUSTC_DUPLICATE 7
|
||||
*/
|
||||
- if(flags & IFA_F_PERMANENT)
|
||||
+ if((flags & IFA_F_PERMANENT) || (!flags) || (flags & IFA_F_TEMPORARY))
|
||||
entry->ia_status = IPADDRESSSTATUSTC_PREFERRED; /* ?? */
|
||||
else if(flags & IFA_F_DEPRECATED)
|
||||
entry->ia_status = IPADDRESSSTATUSTC_DEPRECATED;
|
||||
@@ -294,7 +300,7 @@ _load_v6(netsnmp_container *container, int idx_offset)
|
||||
* if it's not multi, it must be uni.
|
||||
* (an ipv6 address is never broadcast)
|
||||
*/
|
||||
- if (IN6_IS_ADDR_MULTICAST(entry->ia_address))
|
||||
+ if(addr_info.anycastflg)
|
||||
entry->ia_type = IPADDRESSTYPE_ANYCAST;
|
||||
else
|
||||
entry->ia_type = IPADDRESSTYPE_UNICAST;
|
||||
@@ -314,18 +320,28 @@ _load_v6(netsnmp_container *container, int idx_offset)
|
||||
*
|
||||
* are 'local' address assigned by link layer??
|
||||
*/
|
||||
- if (IN6_IS_ADDR_LINKLOCAL(entry->ia_address) ||
|
||||
- IN6_IS_ADDR_SITELOCAL(entry->ia_address))
|
||||
- entry->ia_origin = IPADDRESSORIGINTC_LINKLAYER;
|
||||
- else
|
||||
- entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
|
||||
+ if (!flags)
|
||||
+ entry->ia_origin = IPADDRESSORIGINTC_LINKLAYER;
|
||||
+ else if (flags & IFA_F_TEMPORARY)
|
||||
+ entry->ia_origin = IPADDRESSORIGINTC_RANDOM;
|
||||
+ else if (IN6_IS_ADDR_LINKLOCAL(entry->ia_address))
|
||||
+ entry->ia_origin = IPADDRESSORIGINTC_LINKLAYER;
|
||||
+ else
|
||||
+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
|
||||
+
|
||||
+ if(entry->ia_origin == IPADDRESSORIGINTC_LINKLAYER)
|
||||
+ entry->ia_storagetype = STORAGETYPE_PERMANENT;
|
||||
|
||||
/* xxx-rks: what can we do with scope? */
|
||||
|
||||
/*
|
||||
* add entry to container
|
||||
*/
|
||||
- CONTAINER_INSERT(container, entry);
|
||||
+ 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;
|
||||
+ }
|
||||
}
|
||||
|
||||
fclose(in);
|
||||
@@ -335,4 +351,93 @@ _load_v6(netsnmp_container *container, int idx_offset)
|
||||
|
||||
return idx_offset;
|
||||
}
|
||||
+
|
||||
+struct address_flag_info
|
||||
+netsnmp_access_other_info_get(int index, int family)
|
||||
+{
|
||||
+ struct {
|
||||
+ struct nlmsghdr n;
|
||||
+ struct ifaddrmsg r;
|
||||
+ char buf[1024];
|
||||
+ } req;
|
||||
+ struct address_flag_info addr;
|
||||
+ struct rtattr *rta;
|
||||
+ int status;
|
||||
+ char buf[16384];
|
||||
+ struct nlmsghdr *nlmp;
|
||||
+ struct ifaddrmsg *rtmp;
|
||||
+ struct rtattr *rtatp;
|
||||
+ int rtattrlen;
|
||||
+ int sd;
|
||||
+
|
||||
+ memset(&addr, 0, sizeof(struct address_flag_info));
|
||||
+ sd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE);
|
||||
+ if(sd < 0) {
|
||||
+ snmp_log(LOG_ERR, "could not open netlink socket\n");
|
||||
+ return addr;
|
||||
+ }
|
||||
+
|
||||
+ memset(&req, 0, sizeof(req));
|
||||
+ req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
|
||||
+ req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT;
|
||||
+ req.n.nlmsg_type = RTM_GETADDR;
|
||||
+ req.r.ifa_family = family;
|
||||
+ rta = (struct rtattr *)(((char *)&req) + NLMSG_ALIGN(req.n.nlmsg_len));
|
||||
+ if(family == AF_INET)
|
||||
+ rta->rta_len = RTA_LENGTH(4);
|
||||
+ else
|
||||
+ rta->rta_len = RTA_LENGTH(16);
|
||||
+
|
||||
+ status = send(sd, &req, req.n.nlmsg_len, 0);
|
||||
+ if (status < 0) {
|
||||
+ snmp_log(LOG_ERR, "could not send netlink request\n");
|
||||
+ return addr;
|
||||
+ }
|
||||
+
|
||||
+ status = recv(sd, buf, sizeof(buf), 0);
|
||||
+ if (status < 0) {
|
||||
+ snmp_log (LOG_ERR, "could not recieve netlink request\n");
|
||||
+ return addr;
|
||||
+ }
|
||||
+
|
||||
+ if(status == 0) {
|
||||
+ snmp_log (LOG_ERR, "nothing to read\n");
|
||||
+ return addr;
|
||||
+ }
|
||||
+
|
||||
+ for(nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp);) {
|
||||
+ int len = nlmp->nlmsg_len;
|
||||
+ int req_len = len - sizeof(*nlmp);
|
||||
+
|
||||
+ if (req_len < 0 || len > status) {
|
||||
+ snmp_log (LOG_ERR, "invalid netlink message\n");
|
||||
+ return addr;
|
||||
+ }
|
||||
+
|
||||
+ if (!NLMSG_OK(nlmp, status)) {
|
||||
+ snmp_log (LOG_ERR, "invalid NLMSG message\n");
|
||||
+ return addr;
|
||||
+ }
|
||||
+ rtmp = (struct ifaddrmsg *)NLMSG_DATA(nlmp);
|
||||
+ rtatp = (struct rtattr *)IFA_RTA(rtmp);
|
||||
+ rtattrlen = IFA_PAYLOAD(nlmp);
|
||||
+ if(index == rtmp->ifa_index){
|
||||
+ for (; RTA_OK(rtatp, rtattrlen); rtatp = RTA_NEXT(rtatp, rtattrlen)) {
|
||||
+ if(rtatp->rta_type == IFA_BROADCAST){
|
||||
+ addr.inp = (struct in_addr *)RTA_DATA(rtatp);
|
||||
+ addr.bcastflg = 1;
|
||||
+ }
|
||||
+ if(rtatp->rta_type == IFA_ANYCAST){
|
||||
+ addr.inp = (struct in_addr *)RTA_DATA(rtatp);
|
||||
+ addr.anycastflg = 1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ status -= NLMSG_ALIGN(len);
|
||||
+ nlmp = (struct nlmsghdr*)((char*)nlmp + NLMSG_ALIGN(len));
|
||||
+ }
|
||||
+ close(sd);
|
||||
+ return addr;
|
||||
+}
|
||||
#endif
|
||||
+
|
||||
diff --git a/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
|
||||
index e695ab3..8bb3cbc 100644
|
||||
--- a/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
|
||||
+++ b/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
|
||||
@@ -942,7 +942,10 @@ ipAddressRowStatus_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
|
||||
netsnmp_assert(NULL != ipAddressRowStatus_val_ptr);
|
||||
|
||||
/** WARNING: this code might not work for netsnmp_ipaddress_entry */
|
||||
- (*ipAddressRowStatus_val_ptr) = rowreq_ctx->ipAddressRowStatus;
|
||||
+ if(rowreq_ctx->data->if_index)
|
||||
+ (*ipAddressRowStatus_val_ptr) = rowreq_ctx->ipAddressRowStatus;
|
||||
+ else
|
||||
+ (*ipAddressRowStatus_val_ptr) = ROWSTATUS_NOTREADY;
|
||||
|
||||
return MFD_SUCCESS;
|
||||
} /* ipAddressRowStatus_get */
|
||||
diff --git a/include/net-snmp/library/container.h b/include/net-snmp/library/container.h
|
||||
index f88fa21..22684aa 100644
|
||||
--- a/include/net-snmp/library/container.h
|
||||
+++ b/include/net-snmp/library/container.h
|
||||
@@ -358,7 +358,7 @@ extern "C" {
|
||||
if(x) {
|
||||
int rc = x->insert(x,k);
|
||||
if(rc)
|
||||
- snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n",
|
||||
+ snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n",
|
||||
x->container_name ? x->container_name : "", rc);
|
||||
else {
|
||||
rc = CONTAINER_INSERT_HELPER(x->next, k);
|
||||
diff --git a/snmplib/container.c b/snmplib/container.c
|
||||
index e34e922..1255f0a 100644
|
||||
--- a/snmplib/container.c
|
||||
+++ b/snmplib/container.c
|
||||
@@ -275,7 +275,7 @@ int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k)
|
||||
if(x) {
|
||||
int rc = x->insert(x,k);
|
||||
if(rc)
|
||||
- snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n",
|
||||
+ snmp_log(LOG_DEBUG,"error on subcontainer '%s' insert (%d)\n",
|
||||
x->container_name ? x->container_name : "", rc);
|
||||
else {
|
||||
rc = CONTAINER_INSERT_HELPER(x->next, k);
|
||||
--
|
||||
1.6.0.2
|
||||
|
368
Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch
Normal file
368
Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch
Normal file
@ -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,
|
||||
@@ -273,7 +280,8 @@ config_require(udp-mib/udpEndpointTable/udpEndpointTable_data_access)
|
||||
size_t
|
||||
udpEndpointRemoteAddress_val_ptr_len,
|
||||
u_long udpEndpointRemotePort_val,
|
||||
- u_long udpEndpointInstance_val);
|
||||
+ u_long udpEndpointInstance_val,
|
||||
+ u_long udpEndpointProcess_val);
|
||||
|
||||
|
||||
|
||||
diff --git a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c
|
||||
index af4762f..1e9ef0f 100644
|
||||
--- a/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c
|
||||
+++ b/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c
|
||||
@@ -265,7 +265,8 @@ udpEndpointTable_container_load(netsnmp_container *container)
|
||||
ep->rmt_addr,
|
||||
ep->rmt_addr_len,
|
||||
ep->rmt_port,
|
||||
- ep->instance)) {
|
||||
+ ep->instance,
|
||||
+ ep->pid)) {
|
||||
snmp_log(LOG_ERR,
|
||||
"error setting index while loading "
|
||||
"udpEndpointTable data.\n");
|
||||
diff --git a/agent/mibgroup/util_funcs.c b/agent/mibgroup/util_funcs.c
|
||||
index 95ee4bf..26826f7 100644
|
||||
--- a/agent/mibgroup/util_funcs.c
|
||||
+++ b/agent/mibgroup/util_funcs.c
|
||||
@@ -86,6 +86,20 @@
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
+#if HAVE_DIRENT_H
|
||||
+#include <dirent.h>
|
||||
+#else
|
||||
+# define dirent direct
|
||||
+# if HAVE_SYS_NDIR_H
|
||||
+# include <sys/ndir.h>
|
||||
+# endif
|
||||
+# if HAVE_SYS_DIR_H
|
||||
+# include <sys/dir.h>
|
||||
+# endif
|
||||
+# if HAVE_NDIR_H
|
||||
+# include <ndir.h>
|
||||
+# endif
|
||||
+#endif
|
||||
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
||||
@@ -1192,3 +1206,89 @@ Retrieve_Table_Data(mib_table_t t, int *max_idx)
|
||||
*max_idx = table->next_index - 1;
|
||||
return table->data;
|
||||
}
|
||||
+
|
||||
+#ifdef linux
|
||||
+# define PROC_PATH "/proc"
|
||||
+# define FILE_DISP "fd/"
|
||||
+# define SOCKET_TYPE_1 "socket:["
|
||||
+# define SOCKET_TYPE_2 "[0000]:"
|
||||
+
|
||||
+unsigned long long
|
||||
+extract_inode(char *format)
|
||||
+{
|
||||
+ unsigned long long ret = 0;
|
||||
+
|
||||
+ if (!strncmp(format, SOCKET_TYPE_1, 8)) {
|
||||
+ ret = strtoull(format + 8, NULL, 0);
|
||||
+ } else if (!strncmp(format, SOCKET_TYPE_2, 7)) {
|
||||
+ ret = strtoull(format + 7, NULL, 0);
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+unsigned int
|
||||
+get_pid_from_inode(unsigned long long inode)
|
||||
+{
|
||||
+ DIR *procdirs = NULL, *piddirs = NULL;
|
||||
+ char *name = NULL;
|
||||
+ char path_name[PATH_MAX + 1];
|
||||
+ char socket_lnk[NAME_MAX + 1];
|
||||
+ int filelen = 0, readlen = 0, iflag = 0;
|
||||
+ struct dirent *procinfo, *pidinfo;
|
||||
+ unsigned int pid;
|
||||
+ unsigned long long temp_inode;
|
||||
+
|
||||
+ if (!(procdirs = opendir(PROC_PATH))) {
|
||||
+ snmp_log(LOG_ERR, "snmpd: cannot open /proc\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ while ((procinfo = readdir(procdirs)) != NULL) {
|
||||
+ name = procinfo->d_name;
|
||||
+ for (; *name; name++) {
|
||||
+ if (!isdigit(*name))
|
||||
+ break;
|
||||
+ }
|
||||
+ if(*name)
|
||||
+ continue;
|
||||
+
|
||||
+ memset(path_name, '\0', PATH_MAX + 1);
|
||||
+ filelen = snprintf(path_name, PATH_MAX,
|
||||
+ PROC_PATH "/%s/" FILE_DISP, procinfo->d_name);
|
||||
+ if (filelen <= 0 || PATH_MAX < filelen)
|
||||
+ continue;
|
||||
+
|
||||
+ pid = strtoul(procinfo->d_name, NULL, 0);
|
||||
+
|
||||
+ if (!(piddirs = opendir(path_name)))
|
||||
+ continue;
|
||||
+
|
||||
+ while ((pidinfo = readdir(piddirs)) != NULL) {
|
||||
+ if (filelen + strlen(pidinfo->d_name) > PATH_MAX)
|
||||
+ continue;
|
||||
+
|
||||
+ strcpy(path_name + filelen, pidinfo->d_name);
|
||||
+
|
||||
+ memset(socket_lnk, '\0', NAME_MAX + 1);
|
||||
+ readlen = readlink(path_name, socket_lnk, NAME_MAX);
|
||||
+ if (readlen < 0)
|
||||
+ continue;
|
||||
+ socket_lnk[readlen] = '\0';
|
||||
+
|
||||
+ temp_inode = extract_inode(socket_lnk);
|
||||
+ if (inode == temp_inode) {
|
||||
+ iflag = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ closedir(piddirs);
|
||||
+ if (iflag == 1)
|
||||
+ break;
|
||||
+ }
|
||||
+ if (procdirs)
|
||||
+ closedir(procdirs);
|
||||
+ return pid;
|
||||
+}
|
||||
+
|
||||
+#endif /* #ifdef linux */
|
||||
diff --git a/agent/mibgroup/util_funcs.h b/agent/mibgroup/util_funcs.h
|
||||
index 1b3fefe..4a0b99e 100644
|
||||
--- a/agent/mibgroup/util_funcs.h
|
||||
+++ b/agent/mibgroup/util_funcs.h
|
||||
@@ -34,6 +34,10 @@ void string_append_int(char *, int);
|
||||
void wait_on_exec(struct extensible *);
|
||||
const char *make_tempfile(void);
|
||||
|
||||
+#ifdef linux
|
||||
+unsigned int get_pid_from_inode(unsigned long long);
|
||||
+#endif
|
||||
+
|
||||
#define satosin(x) ((struct sockaddr_in *) &(x))
|
||||
#define SOCKADDR(x) (satosin(x)->sin_addr.s_addr)
|
||||
#ifndef MIB_STATS_CACHE_TIMEOUT
|
||||
diff --git a/include/net-snmp/data_access/udp_endpoint.h b/include/net-snmp/data_access/udp_endpoint.h
|
||||
index cc81b02..b9831ec 100644
|
||||
--- a/include/net-snmp/data_access/udp_endpoint.h
|
||||
+++ b/include/net-snmp/data_access/udp_endpoint.h
|
||||
@@ -41,6 +41,7 @@ extern "C" {
|
||||
u_short rmt_port;
|
||||
|
||||
u_int instance;
|
||||
+ u_int pid;
|
||||
|
||||
} netsnmp_udp_endpoint_entry;
|
||||
|
||||
--
|
||||
1.6.0.2
|
||||
|
7453
Improve-IP-Statistics-tables.patch
Normal file
7453
Improve-IP-Statistics-tables.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,12 +0,0 @@
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=248329
|
||||
|
||||
--- net-snmp-5.1.2/local/snmpconf
|
||||
+++ net-snmp-5.1.2/local/snmpconf
|
||||
@@ -585,6 +585,7 @@
|
||||
}
|
||||
}
|
||||
close(O);
|
||||
+ system("restorecon $outputf");
|
||||
}
|
||||
}
|
||||
|
@ -4604,4 +4604,4 @@ Index: agent/mibgroup/etherlike-mib.h
|
||||
+config_require(etherlike-mib/dot3StatsTable_data_get)
|
||||
+config_require(etherlike-mib/dot3StatsTable_data_set)
|
||||
+config_require(etherlike-mib/dot3StatsTable_data_access)
|
||||
+config_add_mib(ETHERLIKE-MIB)
|
||||
+config_add_mib(EtherLike-MIB)
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: agent/mibgroup/examples/ucdDemoPublic.c
|
||||
===================================================================
|
||||
--- agent/mibgroup/examples/ucdDemoPublic.c.orig
|
||||
+++ 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) {
|
||||
@ -17,8 +17,8 @@ Index: agent/mibgroup/examples/ucdDemoPublic.c
|
||||
publicString[0] = '\0';
|
||||
Index: agent/mibgroup/mibII/system_mib.c
|
||||
===================================================================
|
||||
--- agent/mibgroup/mibII/system_mib.c.orig
|
||||
+++ 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];
|
||||
|
||||
@ -48,9 +48,9 @@ Index: agent/mibgroup/mibII/system_mib.c
|
||||
config_perror(tmpbuf);
|
||||
Index: agent/mibgroup/mibII/var_route.c
|
||||
===================================================================
|
||||
--- agent/mibgroup/mibII/var_route.c.orig
|
||||
+++ agent/mibgroup/mibII/var_route.c
|
||||
@@ -1378,7 +1378,7 @@ Route_Scan_Reload(void)
|
||||
--- 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!
|
||||
*/
|
||||
@ -61,9 +61,9 @@ Index: agent/mibgroup/mibII/var_route.c
|
||||
#endif
|
||||
Index: agent/mibgroup/util_funcs.c
|
||||
===================================================================
|
||||
--- agent/mibgroup/util_funcs.c.orig
|
||||
+++ agent/mibgroup/util_funcs.c
|
||||
@@ -139,6 +139,10 @@ make_tempfile(void)
|
||||
--- 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) {
|
||||
@ -76,18 +76,18 @@ Index: agent/mibgroup/util_funcs.c
|
||||
return name;
|
||||
Index: agent/auto_nlist.c
|
||||
===================================================================
|
||||
--- agent/auto_nlist.c.orig
|
||||
+++ 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)
|
||||
#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))
|
||||
#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';
|
||||
@ -96,8 +96,8 @@ Index: agent/auto_nlist.c
|
||||
#endif
|
||||
Index: apps/snmptest.c
|
||||
===================================================================
|
||||
--- apps/snmptest.c.orig
|
||||
+++ 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;
|
||||
}
|
||||
@ -108,8 +108,8 @@ Index: apps/snmptest.c
|
||||
size_t buf_len = 256;
|
||||
Index: apps/snmptrapd_handlers.c
|
||||
===================================================================
|
||||
--- apps/snmptrapd_handlers.c.orig
|
||||
+++ 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
|
||||
@ -120,7 +120,7 @@ Index: apps/snmptrapd_handlers.c
|
||||
#include <net-snmp/config_api.h>
|
||||
#include <net-snmp/output_api.h>
|
||||
#include <net-snmp/mib_api.h>
|
||||
@@ -840,10 +843,11 @@ do_external(char *cmd, struct hostent *h
|
||||
@@ -863,10 +866,11 @@ do_external(char *cmd, struct hostent *h
|
||||
#else
|
||||
char command_buf[128];
|
||||
char file_buf[L_tmpnam];
|
||||
@ -136,9 +136,9 @@ Index: apps/snmptrapd_handlers.c
|
||||
send_handler_data(file, host, pdu, transport);
|
||||
Index: snmplib/parse.c
|
||||
===================================================================
|
||||
--- snmplib/parse.c.orig
|
||||
+++ snmplib/parse.c
|
||||
@@ -4187,7 +4187,7 @@ static struct node *
|
||||
--- 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];
|
||||
@ -147,7 +147,7 @@ Index: snmplib/parse.c
|
||||
int type = LABEL;
|
||||
int lasttype = LABEL;
|
||||
|
||||
@@ -4279,7 +4279,8 @@ parse(FILE * fp, struct node *root)
|
||||
@@ -4283,7 +4283,8 @@ parse(FILE * fp, struct node *root)
|
||||
case ENDOFFILE:
|
||||
continue;
|
||||
default:
|
||||
@ -157,7 +157,7 @@ Index: snmplib/parse.c
|
||||
type = get_token(fp, token, MAXTOKEN);
|
||||
nnp = NULL;
|
||||
if (type == MACRO) {
|
||||
@@ -4296,7 +4297,8 @@ parse(FILE * fp, struct node *root)
|
||||
@@ -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 */
|
||||
}
|
||||
@ -169,9 +169,9 @@ Index: snmplib/parse.c
|
||||
|
||||
Index: snmplib/tools.c
|
||||
===================================================================
|
||||
--- snmplib/tools.c.orig
|
||||
+++ snmplib/tools.c
|
||||
@@ -695,7 +695,7 @@ dump_snmpEngineID(const u_char * estring
|
||||
--- 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);
|
||||
*/
|
||||
@ -182,8 +182,8 @@ Index: snmplib/tools.c
|
||||
/*NOTREACHED*/ case 5: /* Octets. */
|
||||
Index: testing/TESTCONF.sh
|
||||
===================================================================
|
||||
--- testing/TESTCONF.sh.orig
|
||||
+++ 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
|
||||
@ -197,8 +197,8 @@ Index: testing/TESTCONF.sh
|
||||
if [ "x$SNMP_SAVE_TMPDIR" = "x" ]; then
|
||||
Index: testing/eval_suite.sh
|
||||
===================================================================
|
||||
--- testing/eval_suite.sh.orig
|
||||
+++ testing/eval_suite.sh
|
||||
--- testing/eval_suite.sh.orig 2002-04-20 09:30:29.000000000 +0200
|
||||
+++ testing/eval_suite.sh 2008-10-24 15:30:26.798384612 +0200
|
||||
@@ -79,7 +79,11 @@ exit 0
|
||||
PROGRAM=
|
||||
ARGUMENTS="$*"
|
@ -1,8 +1,8 @@
|
||||
Index: configure.in
|
||||
===================================================================
|
||||
--- configure.in.orig 2007-08-02 00:45:15.851154004 +0200
|
||||
+++ configure.in 2007-08-02 00:45:23.287603014 +0200
|
||||
@@ -1009,7 +1009,7 @@ AC_SUBST(LINKCC)
|
||||
--- 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
|
||||
@ -11,7 +11,7 @@ Index: configure.in
|
||||
changequote(, )
|
||||
PARTIALTARGETOS=`echo $target_os | sed 's/[-._].*//'`
|
||||
changequote([, ])
|
||||
@@ -2737,8 +2737,6 @@ AC_ARG_WITH(libwrap,
|
||||
@@ -2756,8 +2756,6 @@ AC_ARG_WITH(libwrap,
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
# Linux RedHat 6.1 won't link libwrap without libnsl
|
||||
@ -20,7 +20,7 @@ Index: configure.in
|
||||
AC_MSG_CHECKING([for TCP wrappers library -lwrap linked with -lnsl])
|
||||
AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <tcpd.h>
|
||||
@@ -4521,7 +4519,7 @@ fi
|
||||
@@ -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.
|
||||
#
|
||||
@ -29,7 +29,7 @@ Index: configure.in
|
||||
[AC_EGREP_CPP(hz,
|
||||
[#include <netinet/tcp_timer.h>
|
||||
TCPTV_SRTTDFLT
|
||||
@@ -4575,7 +4573,7 @@ fi
|
||||
@@ -4609,7 +4607,7 @@ fi
|
||||
|
||||
ME=`$WHOAMI`
|
||||
if test -f /etc/resolv.conf; then
|
@ -1,7 +1,7 @@
|
||||
Index: net-snmp-config.in
|
||||
===================================================================
|
||||
--- net-snmp-config.in.orig
|
||||
+++ net-snmp-config.in
|
||||
--- net-snmp-config.in.orig 2008-07-30 19:28:08.000000000 +0200
|
||||
+++ net-snmp-config.in 2008-10-24 15:30:56.926874746 +0200
|
||||
@@ -27,6 +27,14 @@ check_build_dir()
|
||||
fi
|
||||
}
|
||||
@ -17,7 +17,7 @@ Index: net-snmp-config.in
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
includedir=@includedir@
|
||||
@@ -104,9 +112,11 @@ else
|
||||
@@ -105,9 +113,11 @@ else
|
||||
;;
|
||||
#################################################### compile
|
||||
--base-cflags)
|
||||
@ -29,7 +29,7 @@ Index: net-snmp-config.in
|
||||
echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR}
|
||||
;;
|
||||
--srcdir)
|
||||
@@ -117,6 +127,7 @@ else
|
||||
@@ -118,6 +128,7 @@ else
|
||||
echo $NSC_LIBDIR
|
||||
;;
|
||||
--ldflags|--ld*)
|
||||
@ -37,7 +37,7 @@ Index: net-snmp-config.in
|
||||
echo $NSC_LDFLAGS
|
||||
;;
|
||||
--build-lib-dirs)
|
||||
@@ -150,30 +161,38 @@ else
|
||||
@@ -151,30 +162,38 @@ else
|
||||
;;
|
||||
#################################################### client lib
|
||||
--libs)
|
||||
@ -76,11 +76,11 @@ Index: net-snmp-config.in
|
||||
echo $NSC_LDFLAGS $NSC_AGENTLIBS
|
||||
;;
|
||||
####################################################
|
||||
@@ -314,6 +333,7 @@ else
|
||||
@@ -316,6 +335,7 @@ else
|
||||
|
||||
####################################################
|
||||
--compile-subagent)
|
||||
+ check_devel_files
|
||||
shift
|
||||
shifted=1
|
||||
while test "x$done" = "x" -a "x$1" != "x" ; do
|
||||
case $1 in
|
@ -1,6 +1,8 @@
|
||||
--- 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 @@
|
||||
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 {
|
||||
@ -9,7 +11,7 @@
|
||||
if (!snmp_strcat
|
||||
(buf, buf_len, out_len, allow_realloc, (const u_char *) tmp)) {
|
||||
return 0;
|
||||
@@ -1585,7 +1585,7 @@
|
||||
@@ -1553,7 +1553,7 @@ sprint_realloc_counter(u_char ** buf, si
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
Index: local/tkmib
|
||||
===================================================================
|
||||
--- local/tkmib.orig 2006-07-27 21:48:25.000000000 +0200
|
||||
+++ local/tkmib 2008-06-21 01:23:34.985622311 +0200
|
||||
+++ local/tkmib 2008-10-24 15:31:02.574384593 +0200
|
||||
@@ -27,10 +27,9 @@ instructions.
|
||||
|
||||
if (!$havetk) {
|
14
net-snmp-5.4.2_snmpconf-selinux.patch
Normal file
14
net-snmp-5.4.2_snmpconf-selinux.patch
Normal file
@ -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");
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
--- testing/rfc1213/snmpfun.sh
|
||||
+++ testing/rfc1213/snmpfun.sh
|
||||
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 @@
|
||||
@@ -11,6 +10,23 @@ else
|
||||
TEST_AUTHPRIV_PARMS="-l authNoPriv -a MD5 -A testpass"
|
||||
fi
|
||||
|
||||
@ -29,7 +31,7 @@
|
||||
config()
|
||||
{
|
||||
rm -f $SNMP_CONFIG_FILE
|
||||
@@ -54,25 +70,35 @@
|
||||
@@ -54,25 +70,35 @@ get_snmpv3_variable()
|
||||
get_snmp_table()
|
||||
{
|
||||
test_start "Access table $2 by SNMPv$1..."
|
||||
@ -76,9 +78,11 @@
|
||||
|
||||
}
|
||||
+
|
||||
--- testing/rfc1213/test_fun
|
||||
+++ testing/rfc1213/test_fun
|
||||
@@ -51,6 +51,9 @@
|
||||
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"
|
||||
@ -88,7 +92,7 @@
|
||||
else
|
||||
fail_num=`expr $fail_num + 1`
|
||||
fail_info "FAIL\n"
|
||||
@@ -66,3 +69,4 @@
|
||||
@@ -66,3 +69,4 @@ summary()
|
||||
fi
|
||||
}
|
||||
|
3373
net-snmp-5.4.2_velocity-mib.patch
Normal file
3373
net-snmp-5.4.2_velocity-mib.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,8 @@
|
||||
Index: Makefile.in
|
||||
===================================================================
|
||||
--- Makefile.in.orig
|
||||
+++ Makefile.in
|
||||
@@ -167,7 +167,7 @@
|
||||
--- 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:
|
@ -1,3 +1,43 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 24 16:54:46 CEST 2008 - mrueckert@suse.de
|
||||
|
||||
- added net-snmp-5.4.2_velocity-mib.patch (FATE#303556)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 24 16:43:34 CEST 2008 - mrueckert@suse.de
|
||||
|
||||
- refreshed patches to apply cleanly:
|
||||
old: net-snmp-5.1.2-snmpconf-selinux.patch
|
||||
new: net-snmp-5.4.2_snmpconf-selinux.patch
|
||||
old: net-snmp-5.2.1-overflow.diff
|
||||
new: net-snmp-5.4.2_overflow.patch
|
||||
old: net-snmp-5.2.1.testing.empty_arptable.patch
|
||||
new: net-snmp-5.4.2_testing.empty_arptable.patch
|
||||
old: net-snmp-5.3.0.1-audit.diff
|
||||
new: nmp-5.4.2_audit.patch
|
||||
old: net-snmp-5.3_vendorperl.patch
|
||||
new: net-snmp-5.4.2_vendorperl.patch
|
||||
old: net-snmp-5.4.1-autoconf.diff
|
||||
new: net-snmp-5.4.2_autoconf.patch
|
||||
old: net-snmp-5.4.1_perl_tk_warning.patch
|
||||
new: net-snmp-5.4.2_perl_tk_warning.patch
|
||||
old: net-snmp-5.4_net-snmp-config_headercheck.patch
|
||||
new: net-snmp-5.4.2_net-snmp-config_headercheck.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Oct 24 14:43:35 CEST 2008 - kkeil@suse.de
|
||||
|
||||
- more IPv6 support from IBM (mainline backports) (bnc#437208)
|
||||
Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch
|
||||
Fix-for-IPv6-Interface-Table.patch
|
||||
Fix-for-Internet-Address-Table.patch
|
||||
Add-ICMP-Statistics-Tables-support.patch
|
||||
Add-Default-Router-Table-support.patch
|
||||
Add-IPv6-support-on-Internet-Address-Translation-Tab.patch
|
||||
Fix-for-Internet-Address-Prefix-Table.patch
|
||||
Add-IPv6-Scope-Zone-Index.patch
|
||||
Improve-IP-Statistics-tables.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 20 17:05:34 CEST 2008 - mrueckert@suse.de
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
postrotate
|
||||
/etc/init.d/snmpd try-restart ||:
|
||||
if [ -x /etc/init.d/snmptrapd ] ; then \
|
||||
/etc/init.d/snmptrapd try-restart ; \
|
||||
/etc/init.d/snmptrapd try-restart ||: ; \
|
||||
fi
|
||||
endscript
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
Name: net-snmp
|
||||
Version: 5.4.2
|
||||
Release: 7
|
||||
Release: 8
|
||||
#
|
||||
License: BSD 3-Clause; X11/MIT
|
||||
Group: Productivity/Networking/Other
|
||||
@ -59,21 +59,31 @@ Source5: net-snmp.logrotate
|
||||
Source6: test_installed
|
||||
Source7: net-snmp.sysconfig
|
||||
Source8: net-snmp-rpmlintrc
|
||||
Patch: net-snmp-5.3.0.1-audit.diff
|
||||
Patch1: net-snmp-5.4.1-autoconf.diff
|
||||
Patch: net-snmp-5.4.2_audit.patch
|
||||
Patch1: net-snmp-5.4.2_autoconf.patch
|
||||
# unused patch atm
|
||||
Patch2: net-snmp-5.2.1-socket_path.diff
|
||||
Patch3: net-snmp-5.4.rc2-versinfo.diff
|
||||
Patch4: net-snmp-5.2.1-overflow.diff
|
||||
Patch5: net-snmp-5.2.1.testing.empty_arptable.patch
|
||||
Patch4: net-snmp-5.4.2_overflow.patch
|
||||
Patch5: net-snmp-5.4.2_testing.empty_arptable.patch
|
||||
Patch6: net-snmp-5.1.1-pie.patch
|
||||
Patch7: net-snmp-5.3_vendorperl.patch
|
||||
Patch8: net-snmp-5.4_net-snmp-config_headercheck.patch
|
||||
Patch9: net-snmp-5.4.1_perl_tk_warning.patch
|
||||
Patch10: net-snmp-5.1.2-snmpconf-selinux.patch
|
||||
Patch7: net-snmp-5.4.2_vendorperl.patch
|
||||
Patch8: net-snmp-5.4.2_net-snmp-config_headercheck.patch
|
||||
Patch9: net-snmp-5.4.2_perl_tk_warning.patch
|
||||
Patch10: net-snmp-5.4.2_snmpconf-selinux.patch
|
||||
Patch11: net-snmp-5.3.0.1_trap-agent-addr_v2.patch
|
||||
Patch12: net-snmp-5.4.1.2-etherlike-mib-revised_1.patch
|
||||
Patch13: net-snmp-5.4.1.2-rmon-mib-revised.patch
|
||||
Patch14: net-snmp-5.4.2_velocity-mib.patch
|
||||
Patch15: Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch
|
||||
Patch16: Fix-for-IPv6-Interface-Table.patch
|
||||
Patch17: Fix-for-Internet-Address-Table.patch
|
||||
Patch18: Add-ICMP-Statistics-Tables-support.patch
|
||||
Patch19: Add-Default-Router-Table-support.patch
|
||||
Patch20: Add-IPv6-support-on-Internet-Address-Translation-Tab.patch
|
||||
Patch21: Fix-for-Internet-Address-Prefix-Table.patch
|
||||
Patch22: Add-IPv6-Scope-Zone-Index.patch
|
||||
Patch23: Improve-IP-Statistics-tables.patch
|
||||
#
|
||||
Summary: SNMP Daemon
|
||||
|
||||
@ -193,16 +203,25 @@ Authors:
|
||||
%patch7
|
||||
%patch8
|
||||
%patch9
|
||||
%patch10 -p1
|
||||
%patch10
|
||||
%patch11
|
||||
%patch12
|
||||
%patch13
|
||||
%patch14
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
%patch21 -p1
|
||||
%patch22 -p1
|
||||
%patch23 -p1
|
||||
find -name "CVS" -type d | xargs -r %{__rm} -rfv
|
||||
find -name ".cvsignore" | xargs -r %{__rm} -fv
|
||||
find -name "*.orig" | xargs -r %{__rm} -fv
|
||||
|
||||
%build
|
||||
#autoconf
|
||||
autoreconf -fi
|
||||
# possibly add later
|
||||
# --with-python-modules \ => need python-setuptools
|
||||
# ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable
|
||||
@ -216,10 +235,14 @@ export CFLAGS="$CFLAGS -fstack-protector-all"
|
||||
--with-mib-modules="misc/ipfwacc \
|
||||
ucd-snmp/diskio \
|
||||
etherlike-mib rmon-mib \
|
||||
velocity \
|
||||
%if 0%{?with_sensors}
|
||||
ucd-snmp/lmSensors \
|
||||
%endif
|
||||
smux" \
|
||||
smux \
|
||||
ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \
|
||||
ip-mib/ipDefaultRouterTable ip-mib/ipAddressPrefixTable \
|
||||
ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable" \
|
||||
--with-persistent-directory=/var/lib/net-snmp \
|
||||
--with-agentx-socket=%{netsnmp_agentx_socket_dir_fhs}/master \
|
||||
--with-sys-location="unknown" \
|
||||
@ -397,6 +420,37 @@ fi
|
||||
%{_bindir}/tkmib
|
||||
|
||||
%changelog
|
||||
* Fri Oct 24 2008 mrueckert@suse.de
|
||||
- added net-snmp-5.4.2_velocity-mib.patch (FATE#303556)
|
||||
* Fri Oct 24 2008 mrueckert@suse.de
|
||||
- refreshed patches to apply cleanly:
|
||||
old: net-snmp-5.1.2-snmpconf-selinux.patch
|
||||
new: net-snmp-5.4.2_snmpconf-selinux.patch
|
||||
old: net-snmp-5.2.1-overflow.diff
|
||||
new: net-snmp-5.4.2_overflow.patch
|
||||
old: net-snmp-5.2.1.testing.empty_arptable.patch
|
||||
new: net-snmp-5.4.2_testing.empty_arptable.patch
|
||||
old: net-snmp-5.3.0.1-audit.diff
|
||||
new: nmp-5.4.2_audit.patch
|
||||
old: net-snmp-5.3_vendorperl.patch
|
||||
new: net-snmp-5.4.2_vendorperl.patch
|
||||
old: net-snmp-5.4.1-autoconf.diff
|
||||
new: net-snmp-5.4.2_autoconf.patch
|
||||
old: net-snmp-5.4.1_perl_tk_warning.patch
|
||||
new: net-snmp-5.4.2_perl_tk_warning.patch
|
||||
old: net-snmp-5.4_net-snmp-config_headercheck.patch
|
||||
new: net-snmp-5.4.2_net-snmp-config_headercheck.patch
|
||||
* Fri Oct 24 2008 kkeil@suse.de
|
||||
- more IPv6 support from IBM (mainline backports) (bnc#437208)
|
||||
Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch
|
||||
Fix-for-IPv6-Interface-Table.patch
|
||||
Fix-for-Internet-Address-Table.patch
|
||||
Add-ICMP-Statistics-Tables-support.patch
|
||||
Add-Default-Router-Table-support.patch
|
||||
Add-IPv6-support-on-Internet-Address-Translation-Tab.patch
|
||||
Fix-for-Internet-Address-Prefix-Table.patch
|
||||
Add-IPv6-Scope-Zone-Index.patch
|
||||
Improve-IP-Statistics-tables.patch
|
||||
* Mon Oct 20 2008 mrueckert@suse.de
|
||||
- remove lzma-alpha-devel. rpm-devel has to require it if it is
|
||||
really needed
|
||||
|
@ -81,7 +81,7 @@ case "$1" in
|
||||
# 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"
|
||||
@ -126,7 +126,7 @@ case "$1" in
|
||||
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`:"
|
||||
|
Loading…
Reference in New Issue
Block a user