fix crash with interfaces without broadcast addresses (like OpenVPN's tun0)

Resolves: #544849
This commit is contained in:
Jan Šafránek 2009-12-21 15:56:44 +00:00
parent e57a6afe9f
commit f055f648cc
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,27 @@
544849 - snmpd segfaults when openvpn is running
Source: upstream, svn rev. 17931
Clear the bcastentry in every loop iteration. If not cleared, the bcastentry
might be insterted into the container twice, when processing an interface
without broadcast address (like OpenVPN's tun0).
diff -up net-snmp-5.5/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c.new net-snmp-5.5/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
--- net-snmp-5.5/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c.new 2009-05-06 23:59:20.000000000 +0200
+++ net-snmp-5.5/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c 2009-12-21 15:58:02.000000000 +0100
@@ -135,7 +135,6 @@ _netsnmp_ioctl_ipaddress_container_load_
struct ifreq *ifrp;
struct sockaddr save_addr;
struct sockaddr_in * si;
- netsnmp_ipaddress_entry *entry, *bcastentry = NULL;
struct address_flag_info addr_info;
in_addr_t ipval;
_ioctl_extras *extras;
@@ -156,6 +155,7 @@ _netsnmp_ioctl_ipaddress_container_load_
ifrp = ifc.ifc_req;
for(i=0; i < interfaces; ++i, ++ifrp) {
+ netsnmp_ipaddress_entry *entry, *bcastentry = NULL;
DEBUGMSGTL(("access:ipaddress:container",
" interface %d, %s\n", i, ifrp->ifr_name));

View File

@ -11,7 +11,7 @@
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: 5.5
Release: 6%{?dist}
Release: 7%{?dist}
Epoch: 1
License: BSD and MIT
@ -31,6 +31,7 @@ Patch2: net-snmp-5.5-dir-fix.patch
Patch3: net-snmp-5.5-multilib.patch
Patch4: net-snmp-5.5-sensors3.patch
Patch5: net-snmp-5.5-udptable-index.patch
Patch6: net-snmp-5.5-missing-bcast.patch
Requires(post): chkconfig
Requires(preun): chkconfig
@ -161,6 +162,7 @@ Net-SNMP toolkit library.
%patch3 -p1 -b .multilib
%patch4 -p1 -b .sensors
%patch5 -p1 -b .udptable-index
%patch6 -p1 -b .missing-bcast
%build
MIBS="host agentx smux \
@ -402,6 +404,10 @@ rm -rf ${RPM_BUILD_ROOT}
%{_datadir}/snmp/mibs/*
%changelog
* Mon Dec 21 2009 Jan Safranek <jsafrane@redhat.com> - 1:5.5-7
- fix crash with interfaces without broadcast addresses (like OpenVPN's tun0)
(#544849)
* Tue Dec 8 2009 Jan Safranek <jsafrane@redhat.com> - 1:5.5-6
- fix compilation of the python module