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

rohara rohara at fedoraproject.org
Mon Mar 26 22:11:31 UTC 2012


commit a7f105e35e4887ea9c1b0ff7862d93e143e48c88
Author: Ryan O'Hara <rohara at redhat.com>
Date:   Mon Mar 26 17:10:24 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 c56f0e5..9184ba7 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: 2%{?dist}
+Release: 3%{?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.init
 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
@@ -23,6 +24,7 @@ offered by the Linux kernel.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 
 %build
@@ -67,6 +69,9 @@ fi
 
 
 %changelog
+* Mon Mar 26 2012 Ryan O'Hara <rohara at redhat.com> 1.26-3
+- Fix list_daemon to not assume sync daemon status is ordered (#805208).
+
 * Mon Jul 11 2011 Matthias Saou <http://freshrpms.net/> 1.26-2
 - Backport the init script from RHEL6, which contains lots of changes to make
   it behave simlarly to the iptables init script (#593276).


More information about the scm-commits mailing list