Python: fixed IPADDRESS size on 64-bit systems

Resolves: #895357
This commit is contained in:
Jan Safranek 2013-01-17 12:42:25 +01:00
parent efaf5fd154
commit 82617ee290
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,23 @@
895357 - net-snmp-python adds zeros to end of IP address (IPADDR type), which is not valid
Source: upstream commit 234158b8e84cc204cbac96e6e9be6959635404b8
--- a/python/netsnmp/client_intf.c
+++ a/python/netsnmp/client_intf.c
@@ -821,14 +821,14 @@ OCT:
case TYPE_IPADDR:
vars->type = ASN_IPADDRESS;
- vars->val.integer = (long *)malloc(sizeof(long));
+ vars->val.integer = (in_addr_t *)malloc(sizeof(in_addr_t));
if (val)
*(vars->val.integer) = inet_addr(val);
else {
ret = FAILURE;
*(vars->val.integer) = 0;
}
- vars->val_len = sizeof(long);
+ vars->val_len = sizeof(in_addr_t);
break;
case TYPE_OBJID:

View File

@ -11,7 +11,7 @@
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: 5.7.2
Release: 4%{?dist}
Release: 5%{?dist}
Epoch: 1
License: BSD
@ -36,6 +36,7 @@ Patch4: net-snmp-5.5-apsl-copying.patch
Patch5: net-snmp-5.5-perl-linking.patch
Patch6: net-snmp-5.6-test-debug.patch
Patch7: net-snmp-5.7.2-systemd.patch
Patch8: net-snmp-5.7.2-python-ipaddress-size.patch
Requires(post): chkconfig
Requires(preun): chkconfig
@ -197,6 +198,7 @@ The net-snmp-sysvinit package provides SysV init scripts for Net-SNMP daemons.
#%patch5 -p1 -b .perl-linking
%patch6 -p1
%patch7 -p1 -b .systemd
%patch8 -p1 -b .ipaddress-size
%ifarch sparc64 s390 s390x
# disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697
@ -489,6 +491,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_initrddir}/snmptrapd
%changelog
* Thu Jan 17 2013 Jan Safranek <jsafrane@redhat.com> - 1:5.7.2-5
- Python: fixed IPADDRESS size on 64-bit systems (#895357)
* Mon Nov 12 2012 Jan Safranek <jsafrane@redhat.com> - 1:5.7.2-4
- Fixed systemd support (#875632).