From 82617ee290c90fcc32d71e792abbb065d605d8c4 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Thu, 17 Jan 2013 12:42:25 +0100 Subject: [PATCH] Python: fixed IPADDRESS size on 64-bit systems Resolves: #895357 --- net-snmp-5.7.2-python-ipaddress-size.patch | 23 ++++++++++++++++++++++ net-snmp.spec | 7 ++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.7.2-python-ipaddress-size.patch diff --git a/net-snmp-5.7.2-python-ipaddress-size.patch b/net-snmp-5.7.2-python-ipaddress-size.patch new file mode 100644 index 0000000..51a489f --- /dev/null +++ b/net-snmp-5.7.2-python-ipaddress-size.patch @@ -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: diff --git a/net-snmp.spec b/net-snmp.spec index db31b82..5e0e43c 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -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 - 1:5.7.2-5 +- Python: fixed IPADDRESS size on 64-bit systems (#895357) + * Mon Nov 12 2012 Jan Safranek - 1:5.7.2-4 - Fixed systemd support (#875632).