rpms/net-snmp/F-7 net-snmp-5.3.1-mib-option.patch, NONE, 1.1 net-snmp-5.3.1-shared-ip.patch, NONE, 1.1 net-snmp-5.4-exec-crash.patch, NONE, 1.1 net-snmp-5.4-hostname.patch, NONE, 1.1 net-snmp-5.4-udp-endpoint.patch, NONE, 1.1 net-snmp.redhat.conf, 1.1, 1.2 net-snmp.spec, 1.112, 1.113
Jan Šafránek (jsafrane)
fedora-extras-commits at redhat.com
Thu Jun 28 09:04:41 UTC 2007
Author: jsafrane
Update of /cvs/pkgs/rpms/net-snmp/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31520
Modified Files:
net-snmp.redhat.conf net-snmp.spec
Added Files:
net-snmp-5.3.1-mib-option.patch net-snmp-5.3.1-shared-ip.patch
net-snmp-5.4-exec-crash.patch net-snmp-5.4-hostname.patch
net-snmp-5.4-udp-endpoint.patch
Log Message:
Syncing with devel
Resolves: 243536
net-snmp-5.3.1-mib-option.patch:
--- NEW FILE net-snmp-5.3.1-mib-option.patch ---
--- net-snmp-5.3.1/snmplib/snmp_parse_args.c.orig 2005-11-23 10:11:40.000000000 +0100
+++ net-snmp-5.3.1/snmplib/snmp_parse_args.c 2007-06-14 13:10:54.000000000 +0200
@@ -275,6 +275,7 @@
break;
case 'M':
+ netsnmp_get_mib_directory(); /* prepare the default directories */
netsnmp_set_mib_directory(optarg);
break;
#endif /* DISABLE_MIB_LOADING */
net-snmp-5.3.1-shared-ip.patch:
--- NEW FILE net-snmp-5.3.1-shared-ip.patch ---
--- net-snmp-5.3.1/include/net-snmp/library/container.h.orig 2005-12-04 19:43:04.000000000 +0100
+++ net-snmp-5.3.1/include/net-snmp/library/container.h 2007-05-04 10:01:38.000000000 +0200
@@ -330,6 +330,11 @@
int CONTAINER_INSERT(netsnmp_container *x, const void *k);
/*
+ * check if k is in any container and insert it into all if not
+ */
+ int CONTAINER_TRY_INSERT(netsnmp_container *x, const void *k);
+
+ /*
* remove k from all containers
*/
int CONTAINER_REMOVE(netsnmp_container *x, const void *k);
@@ -370,8 +370,32 @@
}
}
return rc;
- }
+ }
+
+ int CONTAINER_TRY_INSERT(netsnmp_container *x, const void *k)
+ {
+ const void *res = NULL;
+
+ netsnmp_container *start;
+ /** start at first container */
+ while(x->prev)
+ x = x->prev;
+
+ start = x;
+
+ for(; x; x = x->next) {
+ if ((NULL != x->insert_filter) &&
+ (x->insert_filter(x,k) == 1))
+ continue;
+ res = x->find(x,k);
+ if (res) {
+ return -1;
+ }
+ }
+ return CONTAINER_INSERT(start, k);
+ }
+
/*------------------------------------------------------------------
* These functions should EXACTLY match the function version in
* container.c. If you change one, change them both.
--- net-snmp-5.3.1/snmplib/container.c.orig 2006-04-21 02:24:47.000000000 +0200
+++ net-snmp-5.3.1/snmplib/container.c 2007-05-04 10:34:23.000000000 +0200
@@ -286,6 +286,29 @@
return rc;
}
+int CONTAINER_TRY_INSERT(netsnmp_container *x, const void *k)
+{
+ const void *res = NULL;
+
+ netsnmp_container *start;
+ /** start at first container */
+ while(x->prev)
+ x = x->prev;
+
+ start = x;
+
+ for(; x; x = x->next) {
+ if ((NULL != x->insert_filter) &&
+ (x->insert_filter(x,k) == 1))
+ continue;
+ res = x->find(x,k);
+ if (res) {
+ return -1;
+ }
+ }
+ return CONTAINER_INSERT(start, k);
+}
+
/*------------------------------------------------------------------
* These functions should EXACTLY match the inline version in
* container.h. If you change one, change them both.
--- net-snmp-5.4/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c.orig 2005-10-31 05:32:17.000000000 +0100
+++ net-snmp-5.4/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c 2007-05-04 12:03:17.000000000 +0200
@@ -272,7 +272,16 @@
/*
* add entry to container
*/
- CONTAINER_INSERT(container, entry);
+ rc = CONTAINER_TRY_INSERT(container, entry);
+ if (rc < 0) {
+ static int logged = 0;
+ if (!logged) {
+ snmp_log(LOG_NOTICE, "Duplicate IP address detected, some interfaces may not be visible in IP-MIB\n");
+ logged = 1;
+ }
+ netsnmp_access_ipaddress_entry_free(entry);
+ rc = 0;
+ }
}
/*
--- net-snmp-5.4/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c.orig 2006-09-15 02:48:40.000000000 +0200
+++ net-snmp-5.4/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c 2007-05-04 12:03:44.000000000 +0200
@@ -324,7 +324,17 @@
/*
* add entry to container
*/
- CONTAINER_INSERT(container, entry);
+ rc = CONTAINER_TRY_INSERT(container, entry);
+ if (rc < 0) {
+ static int logged = 0;
+ if (!logged) {
+ snmp_log(LOG_NOTICE, "Duplicate IPv6 address detected, some interfaces may not be visible in IP-MIB\n");
+ logged = 1;
+ }
+ netsnmp_access_ipaddress_entry_free(entry);
+ rc = 0;
+ }
+
}
fclose(in);
net-snmp-5.4-exec-crash.patch:
--- NEW FILE net-snmp-5.4-exec-crash.patch ---
--- net-snmp-5.4/agent/mibgroup/agent/extend.c.orig 2006-10-18 21:07:35.000000000 +0200
+++ net-snmp-5.4/agent/mibgroup/agent/extend.c 2007-06-27 14:30:08.000000000 +0200
@@ -448,6 +448,9 @@
extension->command = strdup( exec_command );
if (cptr)
extension->args = strdup( cptr );
+ } else {
+ snmp_log(LOG_ERR, "Duplicate MIBOID '%s' detected in exec statement, only the first one will be used.\n", exec_name);
+ return;
}
#ifndef USING_UCD_SNMP_EXTENSIBLE_MODULE
net-snmp-5.4-hostname.patch:
--- NEW FILE net-snmp-5.4-hostname.patch ---
--- net-snmp-5.4/apps/snmptrapd_log.c.orig 2006-09-15 02:48:43.000000000 +0200
+++ net-snmp-5.4/apps/snmptrapd_log.c 2007-05-03 12:19:58.000000000 +0200
@@ -626,6 +626,8 @@
char fmt_cmd = options->cmd; /* what we're formatting */
u_char *temp_buf = NULL;
size_t temp_buf_len = 64, temp_out_len = 0;
+ char *tstr;
+ unsigned int oflags;
if ((temp_buf = calloc(temp_buf_len, 1)) == NULL) {
return 0;
@@ -681,125 +683,59 @@
* Write the numerical transport information.
*/
if (transport != NULL && transport->f_fmtaddr != NULL) {
- char *tstr =
- transport->f_fmtaddr(transport, pdu->transport_data,
- pdu->transport_data_length);
- if (!snmp_strcat
- (&temp_buf, &temp_buf_len, &temp_out_len, 1, (u_char *)tstr)) {
- if (tstr != NULL) {
- free(tstr);
- }
- if (temp_buf != NULL) {
- free(temp_buf);
- }
+ oflags = transport->flags;
+ transport->flags &= ~NETSNMP_TRANSPORT_FLAG_HOSTNAME;
+ tstr = transport->f_fmtaddr(transport, pdu->transport_data,
+ pdu->transport_data_length);
+ transport->flags = oflags;
+
+ if (!tstr) goto noip;
+ if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len,
+ 1, (u_char *)tstr)) {
+ SNMP_FREE(temp_buf);
+ SNMP_FREE(tstr);
return 0;
}
- if (tstr != NULL) {
- free(tstr);
- }
+ SNMP_FREE(tstr);
} else {
- if (!snmp_strcat
- (&temp_buf, &temp_buf_len, &temp_out_len, 1,
- "<UNKNOWN>")) {
- if (temp_buf != NULL) {
- free(temp_buf);
- }
+noip:
+ if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len, 1,
+ (const u_char*)"<UNKNOWN>")) {
+ SNMP_FREE(temp_buf);
return 0;
}
}
break;
- /*
- * Write a host name.
- */
case CHR_PDU_NAME:
/*
- * Right, apparently a name lookup is wanted. This is only reasonable
- * for the UDP and TCP transport domains (we don't want to try to be
- * too clever here).
+ * Try to convert the numerical transport information
+ * into a hostname. Or rather, have the transport-specific
+ * address formatting routine do this.
+ * Otherwise falls back to the numeric address format.
*/
-#ifdef NETSNMP_TRANSPORT_TCP_DOMAIN
- if (transport != NULL && (transport->domain == netsnmpUDPDomain ||
- transport->domain ==
- netsnmp_snmpTCPDomain)) {
-#else
- if (transport != NULL && transport->domain == netsnmpUDPDomain) {
-#endif
- /*
- * This is kind of bletcherous -- it breaks the opacity of
- * transport_data but never mind -- the alternative is a lot of
- * munging strings from f_fmtaddr.
- */
- struct sockaddr_in *addr =
- (struct sockaddr_in *) pdu->transport_data;
- if (addr != NULL
- && pdu->transport_data_length ==
- sizeof(struct sockaddr_in)) {
- if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
- NETSNMP_DS_APP_NUMERIC_IP)) {
- host =
- gethostbyaddr((char *) &(addr->sin_addr),
- sizeof(struct in_addr), AF_INET);
- }
- if (host != NULL) {
- if (!snmp_strcat
- (&temp_buf, &temp_buf_len, &temp_out_len, 1,
- (u_char *)host->h_name)) {
- if (temp_buf != NULL) {
- free(temp_buf);
- }
- return 0;
- }
- } else {
- if (!snmp_strcat
- (&temp_buf, &temp_buf_len, &temp_out_len, 1,
- (u_char *)inet_ntoa(addr->sin_addr))) {
- if (temp_buf != NULL) {
- free(temp_buf);
- }
- return 0;
- }
- }
- } else {
- if (!snmp_strcat
- (&temp_buf, &temp_buf_len, &temp_out_len, 1,
- "<UNKNOWN>")) {
- if (temp_buf != NULL) {
- free(temp_buf);
- }
- return 0;
- }
- }
- } else if (transport != NULL && transport->f_fmtaddr != NULL) {
- /*
- * Some other domain for which we do not know how to do a name
- * lookup. Fall back to the formatted transport address.
- */
- char *tstr =
- transport->f_fmtaddr(transport, pdu->transport_data,
- pdu->transport_data_length);
- if (!snmp_strcat
- (&temp_buf, &temp_buf_len, &temp_out_len, 1, (u_char *)tstr)) {
- if (tstr != NULL) {
- free(tstr);
- }
- if (temp_buf != NULL) {
- free(temp_buf);
- }
+ if (transport != NULL && transport->f_fmtaddr != NULL) {
+ oflags = transport->flags;
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_NUMERIC_IP))
+ transport->flags |= NETSNMP_TRANSPORT_FLAG_HOSTNAME;
+ tstr = transport->f_fmtaddr(transport, pdu->transport_data,
+ pdu->transport_data_length);
+ transport->flags = oflags;
+
+ if (!tstr) goto nohost;
+ if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len,
+ 1, (u_char *)tstr)) {
+ SNMP_FREE(temp_buf);
+ SNMP_FREE(tstr);
return 0;
}
- if (tstr != NULL) {
- free(tstr);
- }
+ SNMP_FREE(tstr);
} else {
- /*
- * We are kind of stuck!
- */
+nohost:
if (!snmp_strcat(&temp_buf, &temp_buf_len, &temp_out_len, 1,
- "<UNKNOWN>")) {
- if (temp_buf != NULL) {
- free(temp_buf);
- }
+ (const u_char*)"<UNKNOWN>")) {
+ SNMP_FREE(temp_buf);
return 0;
}
}
--- net-snmp-5.4/snmplib/snmpUDPDomain.c.orig 2006-09-20 01:42:17.000000000 +0200
+++ net-snmp-5.4/snmplib/snmpUDPDomain.c 2007-05-03 12:17:30.000000000 +0200
@@ -87,6 +87,7 @@
netsnmp_udp_fmtaddr(netsnmp_transport *t, void *data, int len)
{
netsnmp_udp_addr_pair *addr_pair = NULL;
+ struct hostent *host;
if (data != NULL && len == sizeof(netsnmp_udp_addr_pair)) {
addr_pair = (netsnmp_udp_addr_pair *) data;
@@ -104,6 +105,10 @@
return strdup("UDP: unknown");
}
+ if ( t && t->flags & NETSNMP_TRANSPORT_FLAG_HOSTNAME ) {
+ host = gethostbyaddr((char *)&to->sin_addr, 4, AF_INET);
+ return (host ? strdup(host->h_name) : NULL);
+ }
sprintf(tmp, "UDP: [%s]:%hu",
inet_ntoa(to->sin_addr), ntohs(to->sin_port));
return strdup(tmp);
--- net-snmp-5.3.1/include/net-snmp/library/snmp_transport.h.orig 2005-09-15 15:46:58.000000000 +0200
+++ net-snmp-5.3.1/include/net-snmp/library/snmp_transport.h 2007-05-02 17:21:30.000000000 +0200
@@ -19,6 +19,7 @@
#define NETSNMP_TRANSPORT_FLAG_STREAM 0x01
#define NETSNMP_TRANSPORT_FLAG_LISTEN 0x02
#define NETSNMP_TRANSPORT_FLAG_TUNNELED 0x04
+#define NETSNMP_TRANSPORT_FLAG_HOSTNAME 0x80 /* for fmtaddr hook */
/* The standard SNMP domains. */
net-snmp-5.4-udp-endpoint.patch:
--- NEW FILE net-snmp-5.4-udp-endpoint.patch ---
Already fixed upstream, should appear in 5.4.1
--- net-snmp-5.4/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c.orig 2006-09-19 05:26:57.000000000 +0200
+++ net-snmp-5.4/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c 2007-05-03 13:21:55.000000000 +0200
@@ -194,7 +194,7 @@
offset, line_info->start));
return PMLP_RC_MEMORY_UNUSED;
}
- ep->loc_addr_len = offset;
+ ep->rmt_addr_len = offset;
ptr += (offset * 2);
++ptr; /* skip ':' */
Index: net-snmp.redhat.conf
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/F-7/net-snmp.redhat.conf,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- net-snmp.redhat.conf 9 Sep 2004 09:10:41 -0000 1.1
+++ net-snmp.redhat.conf 28 Jun 2007 09:03:58 -0000 1.2
@@ -253,7 +253,7 @@
#
# exec NAME PROGRAM [ARGS ...]
#
-# NAME: A generic name.
+# NAME: A generic name. The name must be unique for each exec statement.
# PROGRAM: The program to run. Include the path!
# ARGS: optional arguments to be passed to the program
Index: net-snmp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/net-snmp/F-7/net-snmp.spec,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- net-snmp.spec 12 Mar 2007 14:52:17 -0000 1.112
+++ net-snmp.spec 28 Jun 2007 09:03:58 -0000 1.113
@@ -7,7 +7,7 @@
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: %{major_ver}
-Release: 13%{?dist}
+Release: 14%{?dist}
Epoch: 1
License: BSDish
@@ -38,6 +38,11 @@
Patch14: net-snmp-5.4-free.patch
Patch15: net-snmp-5.4-strange_libpath.patch
Patch16: net-snmp-5.4-snmpassert.patch
+Patch17: net-snmp-5.4-hostname.patch
+Patch18: net-snmp-5.4-udp-endpoint.patch
+Patch19: net-snmp-5.3.1-shared-ip.patch
+Patch20: net-snmp-5.3.1-mib-option.patch
+Patch21: net-snmp-5.4-exec-crash.patch
Requires(pre): /sbin/chkconfig
Requires(post): /sbin/chkconfig
@@ -47,12 +52,12 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: openssl-devel, bzip2-devel, beecrypt-devel, elfutils-devel
BuildRequires: libselinux-devel, elfutils-libelf-devel
-BuildRequires: perl-devel
+#BuildRequires: perl-devel
%ifarch %{ix86} x86_64
BuildRequires: lm_sensors-devel
%endif
%if %{tcp_wrappers}
-BuildRequires: tcp_wrappers-devel
+#BuildRequires: tcp_wrappers-devel
%endif
BuildRequires: perl, coreutils, grep, sed, findutils
@@ -155,6 +160,12 @@
%patch15 -p1 -b .strange_libpath
%patch16 -p1 -b .verboselog
+%patch17 -p1 -b .hostname
+%patch18 -p1 -b .udp-endpoint
+%patch19 -p1 -b .shared-ip
+%patch20 -p1 -b .mib-option
+%patch21 -p1 -b .exec-crash
+
# Do this patch with a perl hack...
perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
@@ -358,6 +369,16 @@
%{_libdir}/lib*.so.*
%changelog
+* Thu Jun 28 2007 Jan Safranek <jsafranek at redhat.com> 5.4-14
+- fix snmptrapd hostname logging (#238587)
+- fix udpEndpointProcess remote IP address (#236551)
+- fix -M option of net-snmp-utils (#244784)
+- default snmptrapd.conf added (#243536)
+- fix crash when multiple exec statements have the same name
+ (#243536)
+- fix ugly error message when more interfaces share
+ one IP address (#209861)
+
* Mon Mar 12 2007 Radek Vokál <rvokal at redhat.com> - 1:5.4-13
- fix overly verbose log message (#221911)
- few minor tweaks for review - still not perfect
More information about the fedora-extras-commits
mailing list