fix udpTable indexes on big-endian systems Resolves: #543352

This commit is contained in:
Jan Šafránek 2009-12-02 09:33:22 +00:00
parent 24da891101
commit 466d568513
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,27 @@
543352: 'make test' fails on big endian system
Source: upstream, SVN rev. 17860
Fix udpTable indexes.
Index: net-snmp/agent/mibgroup/mibII/udpTable.c
===================================================================
--- net-snmp/agent/mibgroup/mibII/udpTable.c (revision 17859)
+++ net-snmp/agent/mibgroup/mibII/udpTable.c (revision 17860)
@@ -361,7 +361,7 @@
{
UDPTABLE_ENTRY_TYPE *entry = (UDPTABLE_ENTRY_TYPE *)*loop_context;
long port;
- in_addr_t addr;
+ long addr;
if (!entry)
return NULL;
@@ -376,7 +376,7 @@
#else
addr = UDP_ADDRESS_TO_NETWORK_ORDER((in_addr_t)entry->UDPTABLE_LOCALADDRESS);
snmp_set_var_value(index, (u_char *)&addr,
- sizeof(entry->UDPTABLE_LOCALADDRESS));
+ sizeof(addr));
#endif
port = UDP_PORT_TO_HOST_ORDER(entry->UDPTABLE_LOCALPORT);
snmp_set_var_value(index->next_variable,

View File

@ -10,7 +10,7 @@
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: 5.5
Release: 3%{?dist}
Release: 4%{?dist}
Epoch: 1
License: BSD and MIT
@ -29,6 +29,7 @@ Patch1: net-snmp-5.4.1-pie.patch
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
Requires(post): chkconfig
Requires(preun): chkconfig
@ -158,6 +159,7 @@ Net-SNMP toolkit library.
%patch2 -p1 -b .dir-fix
%patch3 -p1 -b .multilib
%patch4 -p1 -b .sensors
%patch5 -p1 -b .udptable-index
%build
MIBS="host agentx smux \
@ -399,6 +401,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_datadir}/snmp/mibs/*
%changelog
* Wed Dec 2 2009 Jan Safranek <jsafrane@redhat.com> 1:5.5-4
- fix udpTable indexes on big-endian systems (#543352)
* Wed Nov 25 2009 Jan Safranek <jsafrane@redhat.com> 1:5.5-3
- prepare the .spec file for review
- run automatic regression suite after the compilation of the package