[ipvsadm] Fix list_daemon to not assume sync daemon status is ordered (#805208).

rohara rohara at fedoraproject.org
Tue Jul 10 00:36:51 UTC 2012


commit a4465310e80a5cb3f61ca261a982e1027ca6bead
Author: Ryan O'Hara <rohara at redhat.com>
Date:   Mon Jul 9 19:36:21 2012 -0500

    Fix list_daemon to not assume sync daemon status is ordered (#805208).

 ipvsadm-1.26-list-daemon.patch |   29 +++++++++++++++++++++++++++++
 ipvsadm.spec                   |    7 ++++++-
 2 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/ipvsadm-1.26-list-daemon.patch b/ipvsadm-1.26-list-daemon.patch
new file mode 100644
index 0000000..5300a07
--- /dev/null
+++ b/ipvsadm-1.26-list-daemon.patch
@@ -0,0 +1,29 @@
+diff -Naupr ipvsadm-1.26.orig/ipvsadm.c ipvsadm-1.26/ipvsadm.c
+--- ipvsadm-1.26.orig/ipvsadm.c	2011-02-06 20:38:57.000000000 -0600
++++ ipvsadm-1.26/ipvsadm.c	2012-03-26 16:58:42.796919112 -0500
+@@ -1631,16 +1631,19 @@ void list_timeout(void)
+ static void list_daemon(void)
+ {
+ 	ipvs_daemon_t *u;
++	int i;
+ 
+ 	if (!(u = ipvs_get_daemon()))
+ 		exit(1);
+ 
+-	if (u[0].state & IP_VS_STATE_MASTER)
+-		printf("master sync daemon (mcast=%s, syncid=%d)\n",
+-		       u[0].mcast_ifn, u[0].syncid);
+-	if (u[1].state & IP_VS_STATE_BACKUP)
+-		printf("backup sync daemon (mcast=%s, syncid=%d)\n",
+-		       u[1].mcast_ifn, u[1].syncid);
++	for (i = 0; i < 2; i++) {
++		if (u[i].state & IP_VS_STATE_MASTER)
++			printf("master sync daemon (mcast=%s, syncid=%d)\n",
++			       u[i].mcast_ifn, u[i].syncid);
++		if (u[i].state & IP_VS_STATE_BACKUP)
++			printf("backup sync daemon (mcast=%s, syncid=%d)\n",
++			       u[i].mcast_ifn, u[i].syncid);
++	}
+ 	free(u);
+ }
+ 
diff --git a/ipvsadm.spec b/ipvsadm.spec
index 81e8293..da9dc9a 100644
--- a/ipvsadm.spec
+++ b/ipvsadm.spec
@@ -1,7 +1,7 @@
 Summary: Utility to administer the Linux Virtual Server
 Name: ipvsadm
 Version: 1.26
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: GPLv2+
 Group: Applications/System
 URL: http://www.linuxvirtualserver.org/software/ipvs.html
@@ -9,6 +9,7 @@ Source0: http://www.linuxvirtualserver.org/software/kernel-2.6/ipvsadm-%{version
 Source1: ipvsadm.service
 Source2: ipvsadm-config
 Patch0: ipvsadm-1.26-popt.patch
+Patch1: ipvsadm-1.26-list-daemon.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 Buildrequires: libnl-devel
 Buildrequires: popt-devel
@@ -26,6 +27,7 @@ offered by the Linux kernel.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 
 %build
@@ -92,6 +94,9 @@ fi
 
 
 %changelog
+* Mon Jul  9 2912 Ryan O'Hara <rohara at redhat.com> - 1.26-5
+- Fix list_daemon to not assume sync daemon status is ordered (#805208).
+
 * Thu Apr 19 2012 Jon Ciesla <limburgher at gmail.com> - 1.26-4
 - Migrate to systemd, BZ 720175.
 


More information about the scm-commits mailing list