From 6659c871a58ddc35ab7beaf3bfc50adbaf614cd1 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara Date: Mon, 19 May 2014 23:04:12 -0500 Subject: [PATCH] Fix compiler warnings --- ipvsadm-fix-warnings.patch | 27 +++++++++++++++++++++++++++ ipvsadm-init-variable.patch | 30 ++++++++++++++++++++++++++++++ ipvsadm.spec | 10 +++++++++- 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 ipvsadm-fix-warnings.patch create mode 100644 ipvsadm-init-variable.patch diff --git a/ipvsadm-fix-warnings.patch b/ipvsadm-fix-warnings.patch new file mode 100644 index 0000000..35f7617 --- /dev/null +++ b/ipvsadm-fix-warnings.patch @@ -0,0 +1,27 @@ +--- ipvsadm.c.orig 2013-09-06 04:37:27.000000000 -0400 ++++ ipvsadm.c 2014-02-21 03:10:36.117000000 -0500 +@@ -1240,14 +1240,13 @@ + char *argv[] = { "/sbin/modprobe", "--", "ip_vs", NULL }; + int child; + int status; +- int rc; + + if (!(child = fork())) { + execv(argv[0], argv); + exit(1); + } + +- rc = waitpid(child, &status, 0); ++ waitpid(child, &status, 0); + + if (!WIFEXITED(status) || WEXITSTATUS(status)) { + return 1; +@@ -1429,7 +1428,7 @@ + static void print_largenum(unsigned long long i, unsigned int format) + { + char mytmp[32]; +- size_t len; ++ int len; + + if (format & FMT_EXACT) { + len = snprintf(mytmp, 32, "%llu", i); diff --git a/ipvsadm-init-variable.patch b/ipvsadm-init-variable.patch new file mode 100644 index 0000000..2c3f6fd --- /dev/null +++ b/ipvsadm-init-variable.patch @@ -0,0 +1,30 @@ +From cd824937ad6588be2ec701ee87fba6ee2626e515 Mon Sep 17 00:00:00 2001 +From: Ryan O'Hara +Date: Fri, 17 Jan 2014 11:53:46 -0600 +Subject: [PATCH] libipvs: Initialize ipvs_service_t variable + +The ipvs_get_service function declares an ipvs_service_t type variable +and initializes some of the values, but should really start by +initializing the entire structure. + +Signed-off-by: Ryan O'Hara +Signed-off-by: Jesper Dangaard Brouer +--- + libipvs/libipvs.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c +index d2fec49..8baafed 100644 +--- a/libipvs/libipvs.c ++++ b/libipvs/libipvs.c +@@ -942,6 +942,7 @@ ipvs_get_service(__u32 fwmark, __u16 af, __u16 protocol, union nf_inet_addr addr + if (!svc) + return NULL; + ++ memset(&tsvc, 0, sizeof(tsvc)); + tsvc.fwmark = fwmark; + tsvc.af = af; + tsvc.protocol= protocol; +-- +1.9.0 + diff --git a/ipvsadm.spec b/ipvsadm.spec index 823f3ec..3f6a97b 100644 --- a/ipvsadm.spec +++ b/ipvsadm.spec @@ -1,7 +1,7 @@ Name: ipvsadm Summary: Utility to administer the Linux Virtual Server Version: 1.27 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ URL: https://kernel.org/pub/linux/utils/kernel/ipvsadm/ @@ -9,6 +9,9 @@ Source0: https://kernel.org/pub/linux/utils/kernel/ipvsadm/%{name}-%{version}.ta Source1: ipvsadm.service Source2: ipvsadm-config +Patch0: ipvsadm-init-variable.patch +Patch1: ipvsadm-fix-warnings.patch + Buildrequires: libnl3-devel Buildrequires: popt-devel BuildRequires: systemd @@ -33,6 +36,8 @@ services. Supported Features include: %prep %setup -q +%patch0 -p1 +%patch1 -p0 %build CFLAGS="%{optflags}" make @@ -71,6 +76,9 @@ CFLAGS="%{optflags}" make %{_mandir}/man8/%{name}-save.8* %changelog +* Tue May 20 2014 Ryan O'Hara - 1.27-4 +- Fix compiler warnings + * Mon May 19 2014 Ryan O'Hara - 1.27-3 - Update spec file and fix install paths