From cd82baef39cdb1d5a296066eb535eeb5a2e5bee4 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara Date: Jun 14 2016 17:56:16 +0000 Subject: Remove net-snmp U64 typedef --- diff --git a/keepalived.spec b/keepalived.spec index 919dbf4..76ecfd1 100644 --- a/keepalived.spec +++ b/keepalived.spec @@ -9,7 +9,7 @@ Name: keepalived Summary: High Availability monitor built upon LVS, VRRP and service pollers Version: 1.2.21 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ URL: http://www.keepalived.org/ Group: System Environment/Daemons @@ -17,6 +17,8 @@ Group: System Environment/Daemons Source0: http://www.keepalived.org/software/keepalived-%{version}.tar.gz Source1: keepalived.service +Patch0: remove-net-snmp-U64.patch + Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -47,6 +49,7 @@ infrastructures. %prep %setup -q +%patch0 -p1 %build %configure \ @@ -108,6 +111,9 @@ rm -rf %{buildroot} %{_mandir}/man8/keepalived.8* %changelog +* Tue Jun 14 2016 Ryan O'Hara - 1.2.21-3 +- Remove net-snmp U64 typedef + * Fri Jun 03 2016 Ryan O'Hara - 1.2.21-2 - Remove unnecessary BuildRequires (#1327873) diff --git a/remove-net-snmp-U64.patch b/remove-net-snmp-U64.patch new file mode 100644 index 0000000..473560b --- /dev/null +++ b/remove-net-snmp-U64.patch @@ -0,0 +1,73 @@ +From 9c0427947283c0e67aaa107064546105cc32c5b2 Mon Sep 17 00:00:00 2001 +From: Quentin Armitage +Date: Tue, 7 Jun 2016 08:09:27 +0100 +Subject: [PATCH] Enable compilation with development net-snmp headers + +net-snmp commit https://sourceforge.net/p/net-snmp/code/ci/477b4307ef12ddce3b6a9205e0bdddbfb2e0e9b6/ +removed the typedef U64 that was being used in check_snmp.c. This commit +replaces U64 with the underlying type struct counter64. + +This commit should resolve issue #350. + +Signed-off-by: Quentin Armitage +--- + keepalived/check/check_snmp.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/keepalived/check/check_snmp.c b/keepalived/check/check_snmp.c +index 1351eee..feee5b3 100644 +--- a/keepalived/check/check_snmp.c ++++ b/keepalived/check/check_snmp.c +@@ -310,7 +310,7 @@ check_snmp_virtualserver(struct variable *vp, oid *name, size_t *length, + { + static unsigned long long_ret; + #ifdef _KRNL_2_6_ +- static U64 counter64_ret; ++ static struct counter64 counter64_ret; + #endif + virtual_server_t *v; + element e; +@@ -480,13 +480,13 @@ check_snmp_virtualserver(struct variable *vp, oid *name, size_t *length, + ipvs_update_stats(v); + counter64_ret.low = v->stats.inbytes & 0xffffffff; + counter64_ret.high = v->stats.inbytes >> 32; +- *var_len = sizeof(U64); ++ *var_len = sizeof(struct counter64); + return (u_char*)&counter64_ret; + case CHECK_SNMP_VSSTATSOUTBYTES: + ipvs_update_stats(v); + counter64_ret.low = v->stats.outbytes & 0xffffffff; + counter64_ret.high = v->stats.outbytes >> 32; +- *var_len = sizeof(U64); ++ *var_len = sizeof(struct counter64); + return (u_char*)&counter64_ret; + case CHECK_SNMP_VSRATECPS: + ipvs_update_stats(v); +@@ -579,7 +579,7 @@ check_snmp_realserver(struct variable *vp, oid *name, size_t *length, + { + static unsigned long long_ret; + #ifdef _KRNL_2_6_ +- static U64 counter64_ret; ++ static struct counter64 counter64_ret; + #endif + oid *target, current[2], best[2]; + int result, target_len; +@@ -770,13 +770,13 @@ check_snmp_realserver(struct variable *vp, oid *name, size_t *length, + ipvs_update_stats(bvs); + counter64_ret.low = be->stats.inbytes & 0xffffffff; + counter64_ret.high = be->stats.inbytes >> 32; +- *var_len = sizeof(U64); ++ *var_len = sizeof(struct counter64); + return (u_char*)&counter64_ret; + case CHECK_SNMP_RSSTATSOUTBYTES: + ipvs_update_stats(bvs); + counter64_ret.low = be->stats.outbytes & 0xffffffff; + counter64_ret.high = be->stats.outbytes >> 32; +- *var_len = sizeof(U64); ++ *var_len = sizeof(struct counter64); + return (u_char*)&counter64_ret; + case CHECK_SNMP_RSRATECPS: + ipvs_update_stats(bvs); +-- +2.4.3 +