summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexys Jacob <ultrabug@gentoo.org>2012-07-11 09:38:00 +0000
committerAlexys Jacob <ultrabug@gentoo.org>2012-07-11 09:38:00 +0000
commit2b67b44b519f29e0787d390d27c7f2161272140e (patch)
tree59615702607876b1fa672f052b25b3e411825e3f /sys-cluster/keepalived
parentold (diff)
downloadgentoo-2-2b67b44b519f29e0787d390d27c7f2161272140e.tar.gz
gentoo-2-2b67b44b519f29e0787d390d27c7f2161272140e.tar.bz2
gentoo-2-2b67b44b519f29e0787d390d27c7f2161272140e.zip
Fix #403133 by Alexander Holler, thanks to Greg for testing. Fix #425082 thanks to Ruslan Lutsenko. Add ipv6 USE flag.
(Portage version: 2.1.11.5/cvs/Linux x86_64)
Diffstat (limited to 'sys-cluster/keepalived')
-rw-r--r--sys-cluster/keepalived/ChangeLog11
-rw-r--r--sys-cluster/keepalived/files/keepalived-1.2.2-fix-ipv4-addr-compare.patch23
-rw-r--r--sys-cluster/keepalived/files/keepalived-1.2.2-libipvs-fix-backup-daemon.patch51
-rw-r--r--sys-cluster/keepalived/files/keepalived-1.2.2-libipvs-fix-ipv6.patch33
-rw-r--r--sys-cluster/keepalived/keepalived-1.2.2-r4.ebuild67
5 files changed, 184 insertions, 1 deletions
diff --git a/sys-cluster/keepalived/ChangeLog b/sys-cluster/keepalived/ChangeLog
index 1cc275f2a728..703a32abb696 100644
--- a/sys-cluster/keepalived/ChangeLog
+++ b/sys-cluster/keepalived/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for sys-cluster/keepalived
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/keepalived/ChangeLog,v 1.92 2012/06/06 14:05:00 ranger Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/keepalived/ChangeLog,v 1.93 2012/07/11 09:37:59 ultrabug Exp $
+
+*keepalived-1.2.2-r4 (11 Jul 2012)
+
+ 11 Jul 2012; Ultrabug <ultrabug@gentoo.org> +keepalived-1.2.2-r4.ebuild,
+ +files/keepalived-1.2.2-fix-ipv4-addr-compare.patch,
+ +files/keepalived-1.2.2-libipvs-fix-backup-daemon.patch,
+ +files/keepalived-1.2.2-libipvs-fix-ipv6.patch:
+ Fix #403133 by Alexander Holler, thanks to Greg for testing. Fix #425082
+ thanks to Ruslan Lutsenko. Add ipv6 USE flag.
06 Jun 2012; Brent Baude <ranger@gentoo.org> keepalived-1.2.2-r3.ebuild:
Marking keepalived-1.2.2-r3 ppc64 for bug 371469
diff --git a/sys-cluster/keepalived/files/keepalived-1.2.2-fix-ipv4-addr-compare.patch b/sys-cluster/keepalived/files/keepalived-1.2.2-fix-ipv4-addr-compare.patch
new file mode 100644
index 000000000000..692f042218fc
--- /dev/null
+++ b/sys-cluster/keepalived/files/keepalived-1.2.2-fix-ipv4-addr-compare.patch
@@ -0,0 +1,23 @@
+From bc49a46989c98eb6ee72a379b18b77e87ed624fa Mon Sep 17 00:00:00 2001
+From: Vincent Bernat <bernat@luffy.cx>
+Date: Wed, 07 Dec 2011 09:17:55 +0000
+Subject: Fix IPv4 address comparison routine.
+
+Two different IPv4 addresses were returned to be equal while this was
+not the case. Thanks to Ronie Gilberto Henrich for spotting this bug.
+---
+diff --git a/keepalived/include/check_data.h b/keepalived/include/check_data.h
+index 50a4757..e3ff458 100644
+--- a/keepalived/include/check_data.h
++++ b/keepalived/include/check_data.h
+@@ -163,7 +163,7 @@ static inline int sockstorage_equal(const struct sockaddr_storage *s1,
+ struct sockaddr_in *a1 = (struct sockaddr_in *) s1;
+ struct sockaddr_in *a2 = (struct sockaddr_in *) s2;
+
+- if ((a1->sin_addr.s_addr == a1->sin_addr.s_addr) &&
++ if ((a1->sin_addr.s_addr == a2->sin_addr.s_addr) &&
+ (a1->sin_port == a2->sin_port))
+ return 1;
+ }
+--
+cgit v0.8.3.4
diff --git a/sys-cluster/keepalived/files/keepalived-1.2.2-libipvs-fix-backup-daemon.patch b/sys-cluster/keepalived/files/keepalived-1.2.2-libipvs-fix-backup-daemon.patch
new file mode 100644
index 000000000000..9898122e4d25
--- /dev/null
+++ b/sys-cluster/keepalived/files/keepalived-1.2.2-libipvs-fix-backup-daemon.patch
@@ -0,0 +1,51 @@
+From 8c34d5a0d4c763db9b8f1e54be0c6c3ded6c54e0 Mon Sep 17 00:00:00 2001
+From: Alexander Holler <alexander.holler@1und1.de>
+Date: Mon, 9 Jan 2012 13:16:55 +0100
+Subject: [PATCH] libipvs: Fix reporting of the state of the backup-daemon.
+
+ipvsadm -l --daemon didn't report a running ipvs-backup-daemon
+(if no master-daemon was run).
+
+It seems there was some misunderstanding of
+how the daemons got reported (without using netlink). The state of
+the backup-daemon is always reported (by the kernel) in the second
+element of type ip_vs_daemon_user which is returned by the kernel
+through IP_VS_SO_GET_DAEMON or IPVS_CMD_GET_DAEMON.
+---
+ keepalived/libipvs-2.6/libipvs.c | 11 ++++++-----
+ 1 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/keepalived/libipvs-2.6/libipvs.c b/keepalived/libipvs-2.6/libipvs.c
+index ea5e851..6bee837 100644
+--- a/keepalived/libipvs-2.6/libipvs.c
++++ b/keepalived/libipvs-2.6/libipvs.c
+@@ -1003,12 +1003,9 @@ static int ipvs_daemon_parse_cb(struct nl_msg *msg, void *arg)
+ struct nlattr *attrs[IPVS_CMD_ATTR_MAX + 1];
+ struct nlattr *daemon_attrs[IPVS_DAEMON_ATTR_MAX + 1];
+ ipvs_daemon_t *u = (ipvs_daemon_t *)arg;
++ __u32 state;
+ int i = 0;
+
+- /* We may get two daemons. If we've already got one, this is the second */
+- if (u[0].state)
+- i = 1;
+-
+ if (genlmsg_parse(nlh, 0, attrs, IPVS_CMD_ATTR_MAX, ipvs_cmd_policy) != 0)
+ return -1;
+
+@@ -1021,7 +1018,11 @@ static int ipvs_daemon_parse_cb(struct nl_msg *msg, void *arg)
+ daemon_attrs[IPVS_DAEMON_ATTR_SYNC_ID]))
+ return -1;
+
+- u[i].state = nla_get_u32(daemon_attrs[IPVS_DAEMON_ATTR_STATE]);
++ state = nla_get_u32(daemon_attrs[IPVS_DAEMON_ATTR_STATE]);
++ /* The second element is used for the state of the backup daemon. */
++ if (state == IP_VS_STATE_BACKUP)
++ i = 1;
++ u[i].state = state;
+ strncpy(u[i].mcast_ifn,
+ nla_get_string(daemon_attrs[IPVS_DAEMON_ATTR_MCAST_IFN]),
+ IP_VS_IFNAME_MAXLEN);
+--
+1.7.6.5
+
diff --git a/sys-cluster/keepalived/files/keepalived-1.2.2-libipvs-fix-ipv6.patch b/sys-cluster/keepalived/files/keepalived-1.2.2-libipvs-fix-ipv6.patch
new file mode 100644
index 000000000000..f9435b026242
--- /dev/null
+++ b/sys-cluster/keepalived/files/keepalived-1.2.2-libipvs-fix-ipv6.patch
@@ -0,0 +1,33 @@
+From cf8ff745812b7fe00d509fb50592348b6f60b433 Mon Sep 17 00:00:00 2001
+From: Alexander Holler <alexander.holler@1und1.de>
+Date: Mon, 9 Jan 2012 12:58:12 +0100
+Subject: [PATCH] libipvs: Fix initialization of netlink (needed for IPv6)
+ when the module ip_vs wasn't loaded.
+
+The following happened when keepalived was started before the module for IPVS was loaded:
+
+ipvs_init() failed => netlink got disabled.
+modprobe_ipvs()
+ipvs_init() => netlink was not tested again => no netlink => no IPv6
+
+Fixed through testing netlink always in ipvs_init().
+---
+ keepalived/libipvs-2.6/libipvs.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/keepalived/libipvs-2.6/libipvs.c b/keepalived/libipvs-2.6/libipvs.c
+index 2c75118..ea5e851 100644
+--- a/keepalived/libipvs-2.6/libipvs.c
++++ b/keepalived/libipvs-2.6/libipvs.c
+@@ -114,6 +114,8 @@ int ipvs_init(void)
+ ipvs_func = ipvs_init;
+
+ #ifdef LIBIPVS_USE_NL
++ try_nl = 1;
++
+ if (ipvs_nl_send_message(NULL, NULL, NULL) == 0) {
+ return ipvs_getinfo();
+ }
+--
+1.7.6.5
+
diff --git a/sys-cluster/keepalived/keepalived-1.2.2-r4.ebuild b/sys-cluster/keepalived/keepalived-1.2.2-r4.ebuild
new file mode 100644
index 000000000000..b92edd1eb071
--- /dev/null
+++ b/sys-cluster/keepalived/keepalived-1.2.2-r4.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/keepalived/keepalived-1.2.2-r4.ebuild,v 1.1 2012/07/11 09:37:59 ultrabug Exp $
+
+EAPI=4
+
+inherit autotools base
+
+DESCRIPTION="A strong & robust keepalive facility to the Linux Virtual Server project"
+HOMEPAGE="http://www.keepalived.org/"
+DEBIAN_PATCH=3
+DEBIAN_A="${P/-/_}-${DEBIAN_PATCH}.diff.gz"
+SRC_URI="http://www.keepalived.org/software/${P}.tar.gz
+ mirror://debian/pool/main/${PN:0:1}/${PN}/${DEBIAN_A}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="debug ipv6"
+
+RDEPEND="dev-libs/popt
+ sys-apps/iproute2
+ dev-libs/libnl:1.1
+ dev-libs/openssl"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-2.6.30"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.1.20-do-not-need-kernel-sources.patch
+ "${FILESDIR}"/${PN}-1.2.2-bind-afunspec.patch
+ "${FILESDIR}"/${PN}-1.2.2-fix-ipv4-addr-compare.patch
+ "${FILESDIR}"/${PN}-1.2.2-libipvs-fix-backup-daemon.patch
+)
+
+DOCS=( README CONTRIBUTORS INSTALL VERSION ChangeLog AUTHOR TODO doc/keepalived.conf.SYNOPSIS )
+
+src_prepare() {
+ base_src_prepare
+ EPATCH_OPTS="-p1" epatch "${DISTDIR}"/"${DEBIAN_A}"
+ epatch "${S}"/debian/patches/*patch
+ use ipv6 && epatch "${FILESDIR}"/${PN}-1.2.2-libipvs-fix-ipv6.patch
+ eautoreconf
+}
+
+src_configure() {
+ STRIP=/bin/true \
+ econf \
+ --enable-vrrp \
+ $(use_enable debug)
+}
+
+src_install() {
+ default
+
+ newinitd "${FILESDIR}"/init-keepalived keepalived
+ newconfd "${FILESDIR}"/conf-keepalived keepalived
+
+ docinto genhash
+ dodoc genhash/README genhash/AUTHOR genhash/ChangeLog genhash/VERSION || die
+ # This was badly named by upstream, it's more HOWTO than anything else.
+ newdoc INSTALL INSTALL+HOWTO
+
+ # Security risk to bundle SSL certs
+ rm -f "${ED}"/etc/keepalived/samples/*.pem
+ # Clean up sysvinit files
+ rm -rf "${ED}"/etc/sysconfig "${ED}"/etc/rc.d/
+}