--- keepalived-1.2.2.orig/debian/control +++ keepalived-1.2.2/debian/control @@ -0,0 +1,27 @@ +Source: keepalived +Section: admin +Priority: extra +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Alexander Wirt +Build-Depends: debhelper (>= 5), libssl-dev, libpopt-dev, cdbs, autoconf, linux-libc-dev, libnl-3-dev, libnl-genl-3-dev +Standards-Version: 3.9.2 +Vcs-Browser: https://github.com/formorer/pkg-keepalived +Vcs-Git: git://github.com/formorer/pkg-keepalived.git + +Package: keepalived +Section: admin +Architecture: any +Depends: ${shlibs:Depends}, ipvsadm, iproute, ${misc:Depends} +Description: Failover and monitoring daemon for LVS clusters + keepalived is used for monitoring real servers within a Linux + Virtual Server (LVS) cluster. keepalived can be configured to + remove real servers from the cluster pool if it stops responding, + as well as send a notification email to make the admin aware of + the service failure. + . + In addition, keepalived implements an independent Virtual Router + Redundancy Protocol (VRRPv2; see rfc2338 for additional info) + framework for director failover. + . + You need a kernel >= 2.4.28 or >= 2.6.11 for keepalived. + See README.Debian for more information. --- keepalived-1.2.2.orig/debian/init.d +++ keepalived-1.2.2/debian/init.d @@ -0,0 +1,80 @@ +#! /bin/sh +# +# keepalived LVS cluster monitor daemon. +# +# Written by Andres Salomon +# +### BEGIN INIT INFO +# Provides: keepalived +# Required-Start: $syslog $network $remote_fs +# Required-Stop: $syslog $network $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 1 +# Short-Description: Starts keepalived +# Description: Starts keepalived lvs loadbalancer +### END INIT INFO +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/keepalived +NAME=keepalived +DESC=keepalived +CONFIG=/etc/keepalived/keepalived.conf +TMPFILES="/tmp/.vrrp /tmp/.healthcheckers" + +#includes lsb functions +. /lib/lsb/init-functions + +test -f $CONFIG || exit 0 +test -f $DAEMON || exit 0 + +case "$1" in + start) + log_daemon_msg "Starting $DESC" "$NAME" + for file in $TMPFILES + do + test -e $file && test ! -L $file && rm $file + done + if start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \ + --exec $DAEMON; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + reload|force-reload) + log_action_begin_msg "Reloading $DESC configuration..." + if start-stop-daemon --stop --quiet --signal 1 --pidfile \ + /var/run/$NAME.pid --exec $DAEMON; then + log_end_msg 0 + else + log_action_end_msg 1 + fi + ;; + restart) + log_action_begin_msg "Restarting $DESC" "$NAME" + + start-stop-daemon --stop --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON || true + sleep 1 + if start-stop-daemon --start --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON; then + log_end_msg 0 + else + log_end_msg 1 + fi + ;; + *) + echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 --- keepalived-1.2.2.orig/debian/docs +++ keepalived-1.2.2/debian/docs @@ -0,0 +1,6 @@ +AUTHOR +CONTRIBUTORS +TODO +README +doc/keepalived.conf* +doc/samples --- keepalived-1.2.2.orig/debian/watch +++ keepalived-1.2.2/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://www.keepalived.org/software/keepalived-(.*).tar.gz --- keepalived-1.2.2.orig/debian/changelog +++ keepalived-1.2.2/debian/changelog @@ -0,0 +1,434 @@ +keepalived (1:1.2.2-3ubuntu2.13.04.1) raring-proposed; urgency=low + + * debian/patches/05_fix_address_comparison.patch: + - Two different IPv4 addresses were returned to be + equal while this was not the case. (LP: #1211876) + + -- Adam Stokes Fri, 27 Sep 2013 11:47:47 -0400 + +keepalived (1:1.2.2-3ubuntu2) quantal; urgency=low + + * Rebuild for new armel compiler default of ARMv5t. + + -- Colin Watson Thu, 04 Oct 2012 09:18:58 +0100 + +keepalived (1:1.2.2-3ubuntu1) precise; urgency=low + + * Merge with Debian unstable. Remaining changes: + - debian/rules: DEB_UPDATE_RCD_PARAMS := explicit init start/stop + parameters (don't stop at 0 and 6) + - debian/init.d: init script header adapted to stop rule + - debian/keepalived.postinst: Remove shutdown and reboot links + - Build with libnl3, thanks to a patch from Marc - A. Dahlhaus. + * debian/control: in Build-Depends: libnl3-dev -> libnl-3-dev, + libnl-genl-3-dev. + * debian/patches/ubuntu_libnl3.patch: update patch, make sure it works for + libnl3 3.2.x. + + -- Mathieu Trudel-Lapierre Fri, 23 Dec 2011 09:18:50 -0500 + +keepalived (1:1.2.2-3) unstable; urgency=low + + * [c28d5f0] Readd ip_vs.h - this reenables ipvs (Closes: #649778) + + -- Alexander Wirt Sun, 18 Dec 2011 16:18:06 +0100 + +keepalived (1:1.2.2-2ubuntu1) precise; urgency=low + + * Resynchronise with Debian. Remaining changes: + - debian/rules: DEB_UPDATE_RCD_PARAMS := explicit init start/stop + parameters (don't stop at 0 and 6) + - debian/init.d: init script header adapted to stop rule + - debian/keepalived.postinst: Remove shutdown and reboot links + - Build with libnl3, thanks to a patch from Marc - A. Dahlhaus. + + -- Colin Watson Mon, 28 Nov 2011 15:48:05 +0000 + +keepalived (1:1.2.2-2) unstable; urgency=low + + * [9db4134] Fix override disparity + * [8f0c721] Remove obsolete patch + * [897c0a0] Set correct permissions on pid file. + This is a fix for CVE-2011-1784. + (Closes: #626281) + * [5ab4b8d] Don't use modprobe -k. + Thanks to Sven Ulland for the patch + * [c87fe40] Add vcs headers to control file + * [8107104] Bump standards version - no changes + + -- Alexander Wirt Thu, 10 Nov 2011 08:38:47 +0100 + +keepalived (1:1.2.2-1ubuntu1) precise; urgency=low + + * Resynchronise with Debian. Remaining changes: + - debian/rules: DEB_UPDATE_RCD_PARAMS := explicit init start/stop + parameters (don't stop at 0 and 6) + - debian/init.d: init script header adapted to stop rule + - debian/keepalived.postinst: Remove shutdown and reboot links + * Build with libnl3, thanks to a patch from Marc - A. Dahlhaus. + + -- Colin Watson Tue, 25 Oct 2011 16:10:58 +0100 + +keepalived (1:1.2.2-1) unstable; urgency=low + + * New upstream version + * Don't remove configure in clean target + * Refresh 95_use_linux_ip_vs_h.patch for 1.2 + * Build depend on libnl-dev + + -- Alexander Wirt Sun, 06 Mar 2011 17:43:35 +0100 + +keepalived (1:1.1.20-1ubuntu2) oneiric; urgency=low + + * Rebuild for OpenSSL 1.0.0. + + -- Colin Watson Tue, 17 May 2011 11:32:05 +0100 + +keepalived (1:1.1.20-1ubuntu1) natty; urgency=low + + * Merge from debian unstable (LP: #668818), remaining changes: + - debian/rules: DEB_UPDATE_RCD_PARAMS := expicit init start/stop + parameters (don't stop at 0 and 6) + - debian/init.d: init script header adapted to stop rule + - debian/keepalived.postinst: Remove shutdown and reboot links + + -- Lorenzo De Liso Sat, 30 Oct 2010 20:01:07 +0200 + +keepalived (1:1.1.20-1) unstable; urgency=low + + * Go back to 1.1.20 since 1.2.0 is not ready for release + * Bump standards version (no changes) + + -- Alexander Wirt Sat, 14 Aug 2010 10:17:10 +0200 + +keepalived (1.2.0-1) unstable; urgency=low + + * New upstream release (Closes: #580607) + * Bump standards version (no changes) + + -- Alexander Wirt Sun, 04 Jul 2010 11:02:13 +0200 + +keepalived (1.1.20-1) unstable; urgency=low + + * New upstream release (Closes: #580607) + * Bump standards version (no changes) + * Raise debhelper dep to v5 + * Refresh 95_use_linux_ip_vs_h.patch + * Fix typo in description + * Declare debsource v1.0 + * Fix restart if daemon doesn't run (Closes: #561357) + + -- Alexander Wirt Sat, 08 May 2010 20:56:58 +0200 + +keepalived (1.1.19-1) unstable; urgency=low + + * New upstream version (Closes: #557814, #548254) + - Fix gigabit status interface support (Closes: #555634) + * Fix error reporting and manpage of genhash (Closes: #575399) + + -- Alexander Wirt Fri, 23 Apr 2010 13:17:53 +0200 + +keepalived (1.1.17-2ubuntu1) lucid; urgency=low + + * Merge from debian testing (LP: #519940), remaining changes: + - debian/rules: DEB_UPDATE_RCD_PARAMS := expicit init start/stop + parameters (don't stop at 0 and 6) + - debian/init.d: init script header adapted to stop rule + - debian/keepalived.postinst: Remove shutdown and reboot links + + -- Andres Rodriguez Wed, 10 Feb 2010 13:35:16 -0500 + +keepalived (1.1.17-2) unstable; urgency=low + + * Reenable ipvs support thanks to Vincent Bernat for the hint + (Closes: #530738) + + -- Alexander Wirt Thu, 28 May 2009 09:55:52 +0200 + +keepalived (1.1.17-1ubuntu1) karmic; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/rules: DEB_UPDATE_RCD_PARAMS := expicit init start/stop + parameters (don't stop at 0 and 6) + - debian/init.d: init script header adapted to stop rule + - debian/keepalived.postinst: Remove shutdown and reboot links + + -- Didier Roche Tue, 12 May 2009 20:26:15 +0200 + +keepalived (1.1.17-1) unstable; urgency=low + + * New upstream release (Closes: #516102). + Thanks to Vincent Bernat for the help + * Bump standards version (no changes) + * Remove outdated README.Debian (Closes: #470626) + * support nostrip option (Closes: #478261) + Thanks to Vincent Bernat for the patch + * Extract the patch for 336885 into debian/patches (Closes: #510092) + + -- Alexander Wirt Sun, 26 Apr 2009 19:41:12 +0200 + +keepalived (1.1.15-1ubuntu2) intrepid; urgency=low + + * Replace "multiuser" deprecated init mode in debian/rules with manual + arguments. Adapt the corresponding change in LSB init script header and + runtime dependency in debian/control (LP: #254257) + + -- Didier Roche Fri, 15 Aug 2008 15:58:34 +0200 + +keepalived (1.1.15-1ubuntu1) hardy; urgency=low + + * Merge from debian unstable (LP: #179922), remaining changes: + - debian/rules : DEB_UPDATE_RCD_PARAMS := multiuser parameter added + - debian/control : sysv-rc (>= 2.86.ds1-14.1ubuntu2) added to depends + - debian/control : Set maintainer to Ubuntu Core Developers + - debian : postinst script to remove old shutdown/reboot scripts + + -- Koen Beek Fri, 21 Dec 2007 09:40:47 +0000 + +keepalived (1.1.15-1) unstable; urgency=low + + * New upstream release (Closes: #401827) + * Remove 00_fix-manpagepath.patch and + 01_fix-genhash-manpagepath.patch(obsolete) + * Bump standards version + + -- Alexander Wirt Tue, 18 Dec 2007 18:44:55 +0100 + +keepalived (1.1.13-1ubuntu1) hardy; urgency=low + + * Merge from Debian unstable (LP: #174796), remaining changes: + * Remove stop script symlinks from rc0 and rc6. + * 99_linux_2.6_compat.patch, fix needed to build with current + linux-libc-dev headers: + - Define __KERNEL_STRICT_NAMES to circumvent a conflict between + types in linux/types.h and sys/types.h. + + -- Steve Langasek Fri, 7 Dec 2007 10:42:01 -0800 + +keepalived (1.1.13-1) unstable; urgency=low + + * New upstream release (Closes: #401827) + * Add patch to compile with libc6-dev. Thanks to Cyril Brulebois + for the original patch (Closes: #428927) + + -- Alexander Wirt Tue, 24 Jul 2007 22:24:08 +0200 + +keepalived (1.1.12-1ubuntu2) gutsy; urgency=low + + [ Steve Langasek ] + * 99_linux_2.6_compat.patch, fixes needed to build with current + linux-libc-dev headers: + - Parse LINUX_VERSION_CODE to get a kernel version instead of + relying on UTS_RELEASE, since the latter is deliberately no longer + exported to userspace; and default to 2.6 when a kernel version + can't be detected instead of defaulting to 2.2 which is no longer + interesting (LP: #136534). + - Define __KERNEL_STRICT_NAMES to circumvent a conflict between + types in linux/types.h and sys/types.h. + + [ Daniel Holbach ] + * Modify Maintainer value to match the DebianMaintainerField + specification. + + -- Steve Langasek Wed, 03 Oct 2007 12:47:38 -0700 + +keepalived (1.1.12-1ubuntu1) edgy; urgency=low + + * Remove stop script symlinks from rc0 and rc6. + + -- Scott James Remnant Fri, 15 Sep 2006 17:18:03 +0100 + +keepalived (1.1.12-1) unstable; urgency=low + + * New upstream release (Closes: #365220) + * Call notification for every failure. Thanks to Len Sorenson for + the patch (Closes: #336885) + * delete /tmp/.vrrp and /tmp/.healthcheckers if they exists before + starting keepalived (Closes: #333102) + * bumped standard version + + -- Alexander Wirt Wed, 28 Jun 2006 20:01:56 +0200 + +keepalived (1.1.11-3) unstable; urgency=low + + * Added a warning about sarge kernels to README.Debian and + the package description + + -- Alexander Wirt Fri, 29 Apr 2005 23:22:40 +0200 + +keepalived (1.1.11-2) unstable; urgency=low + + * Added iproute to dependency (Closes: #303421) + + -- Alexander Wirt Fri, 8 Apr 2005 21:45:33 +0200 + +keepalived (1.1.11-1) unstable; urgency=low + + * New upstream release (Closes: #297067) + - Fixes several bugs with his childs which + should fix restart und fork bugs + (Closes: #296516) + * Updated to iv_vs.h 0x010201 (2.6.11) + + -- Alexander Wirt Wed, 2 Mar 2005 21:41:29 +0100 + +keepalived (1.1.7-3) unstable; urgency=low + + * No longer install the config per default (Closes: #261615) + + -- Alexander Wirt Sat, 14 Aug 2004 20:36:43 +0200 + +keepalived (1.1.7-2) unstable; urgency=low + + * New Maintainer: Alexander Wirt + No Bugs, no problems with this package. Thanks for the good + work Andres, I'm happy to take this package + + -- Alexander Wirt Wed, 19 May 2004 20:32:03 +0200 + +keepalived (1.1.7-1) unstable; urgency=low + + * New upstream release. + * 003-genhash_8.patch: drop genhash manpage, as it's been merged upstream. + * 001-genhash_1.patch: add new manpage location fix; should be genhash(1). + + -- Andres Salomon Sun, 02 May 2004 23:44:39 -0400 + +keepalived (1.1.6-1) unstable; urgency=low + + * New upstream release. + * Drop 001-really_distclean.patch and 002-use_destdir.patch; merged + upstream. + * 003-genhash_8.patch: add genhash manpage. + * Update ip_vs.h to version from 2.6.4-1. Keepalived now compiles + using 2.6 headers. Update description accordingly. + * Update copyright file. + * Make init script not check if kernel has IPVS support (closes: #237141). + + -- Andres Salomon Tue, 30 Mar 2004 22:05:24 -0500 + +keepalived (1.1.5-2) unstable; urgency=low + + * Can't use kernel-headers package, not all arch have it. Revert + back to storing headers in debian/ subdir. + + -- Andres Salomon Tue, 10 Feb 2004 02:38:14 -0500 + +keepalived (1.1.5-1) unstable; urgency=low + + * New upstream release. (Closes: #231418) + * Now that ipvs is in 2.4, use kernel-headers package instead of storing + kernel headers in debian/ subdir. Add appropriate build-dep. + * Convert buildsys to cdbs and update standards-version. + * 001-really_distclean.patch: clean binaries out of ./bin. + * 002-use_destdir.patch: add DESTDIR to makefiles. + * Upstream now has manpages for keepalived and keepalived.conf. + + -- Andres Salomon Fri, 30 Jan 2004 02:51:47 -0500 + +keepalived (1.0.3-1) unstable; urgency=low + + * New upstream release; I'm going to wait for this release to enter + testing before allowing the 1.1.x series into unstable. (Closes: #199437) + * Update maintainer email address. + * Update standards-version. + * Update kernel headers and scripts. + + -- Andres Salomon Sat, 26 Jul 2003 01:03:19 -0400 + +keepalived (1.0.2-1) unstable; urgency=low + + * New upstream release. + * Fixed previous changelog entry's year (2002 -> 2003), so it doesn's appear + that I time travel. At the very least, I wouldn't want people discovering + my secret, and risk my time machine falling into the wrong hands. + * Upstream docs changed location; updated. + * Dropped dh_undocumented usage. + * Added reload support to the init script. + + -- Andres Salomon Thu, 17 Apr 2003 00:38:48 -0500 + +keepalived (1.0.0-1) unstable; urgency=low + + * New upstream release. + * Update standards-version to 3.5.8.0. + * Update kernel headers for ipvs-1.0.7. + + -- Andres Salomon Fri, 17 Jan 2003 15:26:38 -0400 + +keepalived (0.7.6-1) unstable; urgency=low + + * New upstream release. + * Several minor description/copyright changes to make new lintian happy. + * Add removal of config.log to clean target in debian/rules. + + -- Andres Salomon Sun, 8 Dec 2002 23:59:17 -0400 + +keepalived (0.7.1-1) unstable; urgency=low + + * New upstream release. + * Update kernel headers for ipvs-1.0.6. + * Remove dependance upon gcc-3.0; upstream says 2.95 works fine now, + and we should be transitioning to gcc-3.2 soon, anyways (hopefully). + + -- Andres Salomon Sat, 21 Sep 2002 16:05:52 -0400 + +keepalived (0.6.10-2) unstable; urgency=low + + * Add OpenSSL exception clause to the copyright file. + + -- Andres Salomon Thu, 22 Aug 2002 11:48:16 -0400 + +keepalived (0.6.10-1) unstable; urgency=low + + * New upstream release. + * Update kernel headers to 2.4.19 and ipvs-1.0.4. + + -- Andres Salomon Wed, 14 Aug 2002 23:42:48 -0400 + +keepalived (0.6.8-1) unstable; urgency=low + + * New upstream release. + * Updated description to mention VRRPv2. + * Depend upon gcc-3.0, since gcc-2.95 and keepalived have, uh, issues. + * Updated various paths to reflect changed build system/layout. + + -- Andres Salomon Thu, 18 Jul 2002 01:47:42 -0500 + +keepalived (0.6.2-1) unstable; urgency=low + + * New upstream release, upload to archive. (Closes: #144100) + * Autoconf sanity upstream, remove configure.in/Makefile.in patches. + * Fix typo in top level Makefile.in. + * Updated URL for keepalived (keepalived.sf.net -> www.keepalived.org). + * For easier maintenance of kernel header files, grab scripts from my + devmapper package. + + -- Andres Salomon Sun, 16 Jun 2002 15:47:39 -0500 + +keepalived (0.5.8-1) unstable; urgency=low + + * New upstream release. + * Note the OpenSSL exception clause in the README. + + -- Andres Salomon Tue, 21 May 2002 15:18:02 -0500 + +keepalived (0.5.7-1) unstable; urgency=low + + * New upstream release (w/ SSL_GET fixes!). + * Moved sample configs to doc directory. + + -- Andres Salomon Thu, 2 May 2002 20:14:38 -0500 + +keepalived (0.5.6-1) unstable; urgency=low + + * New upstream release. + + -- Andres Salomon Thu, 11 Apr 2002 01:38:19 -0500 + +keepalived (0.5.5-1) unstable; urgency=low + + * Initial Release. + + -- Andres Salomon Thu, 11 Apr 2002 01:38:19 -0500 + --- keepalived-1.2.2.orig/debian/compat +++ keepalived-1.2.2/debian/compat @@ -0,0 +1 @@ +5 --- keepalived-1.2.2.orig/debian/keepalived.postinst +++ keepalived-1.2.2/debian/keepalived.postinst @@ -0,0 +1,8 @@ +#!/bin/sh + +# Remove shutdown and reboot links; this init script does not need them. +if dpkg --compare-versions "$2" lt "1.1.12-1ubuntu1"; then + rm -f /etc/rc0.d/K20keepalived /etc/rc6.d/K20keepalived +fi + +#DEBHELPER# --- keepalived-1.2.2.orig/debian/dirs +++ keepalived-1.2.2/debian/dirs @@ -0,0 +1,4 @@ +usr/bin +usr/sbin +etc/keepalived +usr/share/doc/keepalived/samples --- keepalived-1.2.2.orig/debian/rules +++ keepalived-1.2.2/debian/rules @@ -0,0 +1,23 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk +include /usr/share/cdbs/1/class/autotools.mk + +DEB_UPDATE_RCD_PARAMS := start 20 2 3 4 5 . stop 20 1 . + +DEB_AUTO_UPDATE_AUTOCONF = 2.50 +DEB_CONFIGURE_SCRIPT_ENV := STRIP=/bin/true $(DEB_CONFIGURE_SCRIPT_ENV) +DEB_CONFIGURE_EXTRA_FLAGS := --with-kernel-dir=debian/ + +binary-install/keepalived:: + rm -rf $(DEB_DESTDIR)/etc/keepalived/samples + rm -rf $(DEB_DESTDIR)/etc/keepalived/keepalived.conf + rm -rf $(DEB_DESTDIR)/etc/init.d/keepalived.init + rm -rf $(DEB_DESTDIR)/etc/rc.d + rm -rf $(DEB_DESTDIR)/etc/sysconfig + rm -rf $(DEB_DESTDIR)/usr/man + +clean:: + -rm config.status + -rm config.log --- keepalived-1.2.2.orig/debian/copyright +++ keepalived-1.2.2/debian/copyright @@ -0,0 +1,40 @@ +This package was debianized by Andres Salomon on +Thu, 11 Apr 2002 01:38:19 -0400. + +And is now maintained from Alexander Wirt on +Do Mai 20 00:51:09 CEST 2004 + +It was downloaded from http://www.keepalived.org/ + +Upstream Author: Alexandre Cassen + +Copyright (C) 2001-2004 Alexandre Cassen + +keepalived is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +keepalived is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +MA 02110-1301, USA. + + +On Debian systems, the full text of the GPL can be found in +/usr/share/common-licenses/GPL + +Additionally, the following clause applies: + +In addition, as the copyright holder of Keepalived, +I, Alexandre Cassen, , +grant the following special exception: + + I, Alexandre Cassen, , explicitly allow + the compilation and distribution of the Keepalived software with + the OpenSSL Toolkit. --- keepalived-1.2.2.orig/debian/include/net/ip_vs.h +++ keepalived-1.2.2/debian/include/net/ip_vs.h @@ -0,0 +1,429 @@ +/* + * IP Virtual Server + * data structure and functionality definitions + */ + +#ifndef _IP_VS_H +#define _IP_VS_H + +#include /* For __beXX types in userland */ + +#define IP_VS_VERSION_CODE 0x010201 +#define NVERSION(version) \ + (version >> 16) & 0xFF, \ + (version >> 8) & 0xFF, \ + version & 0xFF + +/* + * Virtual Service Flags + */ +#define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */ +#define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */ +#define IP_VS_SVC_F_ONEPACKET 0x0004 /* one-packet scheduling */ + +/* + * Destination Server Flags + */ +#define IP_VS_DEST_F_AVAILABLE 0x0001 /* server is available */ +#define IP_VS_DEST_F_OVERLOAD 0x0002 /* server is overloaded */ + +/* + * IPVS sync daemon states + */ +#define IP_VS_STATE_NONE 0x0000 /* daemon is stopped */ +#define IP_VS_STATE_MASTER 0x0001 /* started as master */ +#define IP_VS_STATE_BACKUP 0x0002 /* started as backup */ + +/* + * IPVS socket options + */ +#define IP_VS_BASE_CTL (64+1024+64) /* base */ + +#define IP_VS_SO_SET_NONE IP_VS_BASE_CTL /* just peek */ +#define IP_VS_SO_SET_INSERT (IP_VS_BASE_CTL+1) +#define IP_VS_SO_SET_ADD (IP_VS_BASE_CTL+2) +#define IP_VS_SO_SET_EDIT (IP_VS_BASE_CTL+3) +#define IP_VS_SO_SET_DEL (IP_VS_BASE_CTL+4) +#define IP_VS_SO_SET_FLUSH (IP_VS_BASE_CTL+5) +#define IP_VS_SO_SET_LIST (IP_VS_BASE_CTL+6) +#define IP_VS_SO_SET_ADDDEST (IP_VS_BASE_CTL+7) +#define IP_VS_SO_SET_DELDEST (IP_VS_BASE_CTL+8) +#define IP_VS_SO_SET_EDITDEST (IP_VS_BASE_CTL+9) +#define IP_VS_SO_SET_TIMEOUT (IP_VS_BASE_CTL+10) +#define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11) +#define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12) +#define IP_VS_SO_SET_RESTORE (IP_VS_BASE_CTL+13) +#define IP_VS_SO_SET_SAVE (IP_VS_BASE_CTL+14) +#define IP_VS_SO_SET_ZERO (IP_VS_BASE_CTL+15) +#define IP_VS_SO_SET_MAX IP_VS_SO_SET_ZERO + +#define IP_VS_SO_GET_VERSION IP_VS_BASE_CTL +#define IP_VS_SO_GET_INFO (IP_VS_BASE_CTL+1) +#define IP_VS_SO_GET_SERVICES (IP_VS_BASE_CTL+2) +#define IP_VS_SO_GET_SERVICE (IP_VS_BASE_CTL+3) +#define IP_VS_SO_GET_DESTS (IP_VS_BASE_CTL+4) +#define IP_VS_SO_GET_DEST (IP_VS_BASE_CTL+5) /* not used now */ +#define IP_VS_SO_GET_TIMEOUT (IP_VS_BASE_CTL+6) +#define IP_VS_SO_GET_DAEMON (IP_VS_BASE_CTL+7) +#define IP_VS_SO_GET_MAX IP_VS_SO_GET_DAEMON + + +/* + * IPVS Connection Flags + * Only flags 0..15 are sent to backup server + */ +#define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */ +#define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */ +#define IP_VS_CONN_F_LOCALNODE 0x0001 /* local node */ +#define IP_VS_CONN_F_TUNNEL 0x0002 /* tunneling */ +#define IP_VS_CONN_F_DROUTE 0x0003 /* direct routing */ +#define IP_VS_CONN_F_BYPASS 0x0004 /* cache bypass */ +#define IP_VS_CONN_F_SYNC 0x0020 /* entry created by sync */ +#define IP_VS_CONN_F_HASHED 0x0040 /* hashed entry */ +#define IP_VS_CONN_F_NOOUTPUT 0x0080 /* no output packets */ +#define IP_VS_CONN_F_INACTIVE 0x0100 /* not established */ +#define IP_VS_CONN_F_OUT_SEQ 0x0200 /* must do output seq adjust */ +#define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */ +#define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */ +#define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */ +#define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ +#define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */ + +#define IP_VS_CONN_F_BACKUP_MASK (IP_VS_CONN_F_FWD_MASK | \ + IP_VS_CONN_F_NOOUTPUT | \ + IP_VS_CONN_F_INACTIVE | \ + IP_VS_CONN_F_SEQ_MASK | \ + IP_VS_CONN_F_NO_CPORT | \ + IP_VS_CONN_F_TEMPLATE \ + ) + +/* Flags that are not sent to backup server start from bit 16 */ +#define IP_VS_CONN_F_NFCT (1 << 16) /* use netfilter conntrack */ + +/* Connection flags from destination that can be changed by user space */ +#define IP_VS_CONN_F_DEST_MASK (IP_VS_CONN_F_FWD_MASK | \ + IP_VS_CONN_F_ONE_PACKET | \ + IP_VS_CONN_F_NFCT | \ + 0) + +#define IP_VS_SCHEDNAME_MAXLEN 16 +#define IP_VS_PENAME_MAXLEN 16 +#define IP_VS_IFNAME_MAXLEN 16 + +#define IP_VS_PEDATA_MAXLEN 255 + +/* + * The struct ip_vs_service_user and struct ip_vs_dest_user are + * used to set IPVS rules through setsockopt. + */ +struct ip_vs_service_user { + /* virtual service addresses */ + __u16 protocol; + __be32 addr; /* virtual ip address */ + __be16 port; + __u32 fwmark; /* firwall mark of service */ + + /* virtual service options */ + char sched_name[IP_VS_SCHEDNAME_MAXLEN]; + unsigned flags; /* virtual service flags */ + unsigned timeout; /* persistent timeout in sec */ + __be32 netmask; /* persistent netmask */ +}; + + +struct ip_vs_dest_user { + /* destination server address */ + __be32 addr; + __be16 port; + + /* real server options */ + unsigned conn_flags; /* connection flags */ + int weight; /* destination weight */ + + /* thresholds for active connections */ + __u32 u_threshold; /* upper threshold */ + __u32 l_threshold; /* lower threshold */ +}; + + +/* + * IPVS statistics object (for user space) + */ +struct ip_vs_stats_user { + __u32 conns; /* connections scheduled */ + __u32 inpkts; /* incoming packets */ + __u32 outpkts; /* outgoing packets */ + __u64 inbytes; /* incoming bytes */ + __u64 outbytes; /* outgoing bytes */ + + __u32 cps; /* current connection rate */ + __u32 inpps; /* current in packet rate */ + __u32 outpps; /* current out packet rate */ + __u32 inbps; /* current in byte rate */ + __u32 outbps; /* current out byte rate */ +}; + + +/* The argument to IP_VS_SO_GET_INFO */ +struct ip_vs_getinfo { + /* version number */ + unsigned int version; + + /* size of connection hash table */ + unsigned int size; + + /* number of virtual services */ + unsigned int num_services; +}; + + +/* The argument to IP_VS_SO_GET_SERVICE */ +struct ip_vs_service_entry { + /* which service: user fills in these */ + __u16 protocol; + __be32 addr; /* virtual address */ + __be16 port; + __u32 fwmark; /* firwall mark of service */ + + /* service options */ + char sched_name[IP_VS_SCHEDNAME_MAXLEN]; + unsigned flags; /* virtual service flags */ + unsigned timeout; /* persistent timeout */ + __be32 netmask; /* persistent netmask */ + + /* number of real servers */ + unsigned int num_dests; + + /* statistics */ + struct ip_vs_stats_user stats; +}; + + +struct ip_vs_dest_entry { + __be32 addr; /* destination address */ + __be16 port; + unsigned conn_flags; /* connection flags */ + int weight; /* destination weight */ + + __u32 u_threshold; /* upper threshold */ + __u32 l_threshold; /* lower threshold */ + + __u32 activeconns; /* active connections */ + __u32 inactconns; /* inactive connections */ + __u32 persistconns; /* persistent connections */ + + /* statistics */ + struct ip_vs_stats_user stats; +}; + + +/* The argument to IP_VS_SO_GET_DESTS */ +struct ip_vs_get_dests { + /* which service: user fills in these */ + __u16 protocol; + __be32 addr; /* virtual address */ + __be16 port; + __u32 fwmark; /* firwall mark of service */ + + /* number of real servers */ + unsigned int num_dests; + + /* the real servers */ + struct ip_vs_dest_entry entrytable[0]; +}; + + +/* The argument to IP_VS_SO_GET_SERVICES */ +struct ip_vs_get_services { + /* number of virtual services */ + unsigned int num_services; + + /* service table */ + struct ip_vs_service_entry entrytable[0]; +}; + + +/* The argument to IP_VS_SO_GET_TIMEOUT */ +struct ip_vs_timeout_user { + int tcp_timeout; + int tcp_fin_timeout; + int udp_timeout; +}; + + +/* The argument to IP_VS_SO_GET_DAEMON */ +struct ip_vs_daemon_user { + /* sync daemon state (master/backup) */ + int state; + + /* multicast interface name */ + char mcast_ifn[IP_VS_IFNAME_MAXLEN]; + + /* SyncID we belong to */ + int syncid; +}; + +/* + * + * IPVS Generic Netlink interface definitions + * + */ + +/* Generic Netlink family info */ + +#define IPVS_GENL_NAME "IPVS" +#define IPVS_GENL_VERSION 0x1 + +struct ip_vs_flags { + __be32 flags; + __be32 mask; +}; + +/* Generic Netlink command attributes */ +enum { + IPVS_CMD_UNSPEC = 0, + + IPVS_CMD_NEW_SERVICE, /* add service */ + IPVS_CMD_SET_SERVICE, /* modify service */ + IPVS_CMD_DEL_SERVICE, /* delete service */ + IPVS_CMD_GET_SERVICE, /* get service info */ + + IPVS_CMD_NEW_DEST, /* add destination */ + IPVS_CMD_SET_DEST, /* modify destination */ + IPVS_CMD_DEL_DEST, /* delete destination */ + IPVS_CMD_GET_DEST, /* get destination info */ + + IPVS_CMD_NEW_DAEMON, /* start sync daemon */ + IPVS_CMD_DEL_DAEMON, /* stop sync daemon */ + IPVS_CMD_GET_DAEMON, /* get sync daemon status */ + + IPVS_CMD_SET_CONFIG, /* set config settings */ + IPVS_CMD_GET_CONFIG, /* get config settings */ + + IPVS_CMD_SET_INFO, /* only used in GET_INFO reply */ + IPVS_CMD_GET_INFO, /* get general IPVS info */ + + IPVS_CMD_ZERO, /* zero all counters and stats */ + IPVS_CMD_FLUSH, /* flush services and dests */ + + __IPVS_CMD_MAX, +}; + +#define IPVS_CMD_MAX (__IPVS_CMD_MAX - 1) + +/* Attributes used in the first level of commands */ +enum { + IPVS_CMD_ATTR_UNSPEC = 0, + IPVS_CMD_ATTR_SERVICE, /* nested service attribute */ + IPVS_CMD_ATTR_DEST, /* nested destination attribute */ + IPVS_CMD_ATTR_DAEMON, /* nested sync daemon attribute */ + IPVS_CMD_ATTR_TIMEOUT_TCP, /* TCP connection timeout */ + IPVS_CMD_ATTR_TIMEOUT_TCP_FIN, /* TCP FIN wait timeout */ + IPVS_CMD_ATTR_TIMEOUT_UDP, /* UDP timeout */ + __IPVS_CMD_ATTR_MAX, +}; + +#define IPVS_CMD_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1) + +/* + * Attributes used to describe a service + * + * Used inside nested attribute IPVS_CMD_ATTR_SERVICE + */ +enum { + IPVS_SVC_ATTR_UNSPEC = 0, + IPVS_SVC_ATTR_AF, /* address family */ + IPVS_SVC_ATTR_PROTOCOL, /* virtual service protocol */ + IPVS_SVC_ATTR_ADDR, /* virtual service address */ + IPVS_SVC_ATTR_PORT, /* virtual service port */ + IPVS_SVC_ATTR_FWMARK, /* firewall mark of service */ + + IPVS_SVC_ATTR_SCHED_NAME, /* name of scheduler */ + IPVS_SVC_ATTR_FLAGS, /* virtual service flags */ + IPVS_SVC_ATTR_TIMEOUT, /* persistent timeout */ + IPVS_SVC_ATTR_NETMASK, /* persistent netmask */ + + IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */ + + IPVS_SVC_ATTR_PE_NAME, /* name of ct retriever */ + + __IPVS_SVC_ATTR_MAX, +}; + +#define IPVS_SVC_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1) + +/* + * Attributes used to describe a destination (real server) + * + * Used inside nested attribute IPVS_CMD_ATTR_DEST + */ +enum { + IPVS_DEST_ATTR_UNSPEC = 0, + IPVS_DEST_ATTR_ADDR, /* real server address */ + IPVS_DEST_ATTR_PORT, /* real server port */ + + IPVS_DEST_ATTR_FWD_METHOD, /* forwarding method */ + IPVS_DEST_ATTR_WEIGHT, /* destination weight */ + + IPVS_DEST_ATTR_U_THRESH, /* upper threshold */ + IPVS_DEST_ATTR_L_THRESH, /* lower threshold */ + + IPVS_DEST_ATTR_ACTIVE_CONNS, /* active connections */ + IPVS_DEST_ATTR_INACT_CONNS, /* inactive connections */ + IPVS_DEST_ATTR_PERSIST_CONNS, /* persistent connections */ + + IPVS_DEST_ATTR_STATS, /* nested attribute for dest stats */ + __IPVS_DEST_ATTR_MAX, +}; + +#define IPVS_DEST_ATTR_MAX (__IPVS_DEST_ATTR_MAX - 1) + +/* + * Attributes describing a sync daemon + * + * Used inside nested attribute IPVS_CMD_ATTR_DAEMON + */ +enum { + IPVS_DAEMON_ATTR_UNSPEC = 0, + IPVS_DAEMON_ATTR_STATE, /* sync daemon state (master/backup) */ + IPVS_DAEMON_ATTR_MCAST_IFN, /* multicast interface name */ + IPVS_DAEMON_ATTR_SYNC_ID, /* SyncID we belong to */ + __IPVS_DAEMON_ATTR_MAX, +}; + +#define IPVS_DAEMON_ATTR_MAX (__IPVS_DAEMON_ATTR_MAX - 1) + +/* + * Attributes used to describe service or destination entry statistics + * + * Used inside nested attributes IPVS_SVC_ATTR_STATS and IPVS_DEST_ATTR_STATS + */ +enum { + IPVS_STATS_ATTR_UNSPEC = 0, + IPVS_STATS_ATTR_CONNS, /* connections scheduled */ + IPVS_STATS_ATTR_INPKTS, /* incoming packets */ + IPVS_STATS_ATTR_OUTPKTS, /* outgoing packets */ + IPVS_STATS_ATTR_INBYTES, /* incoming bytes */ + IPVS_STATS_ATTR_OUTBYTES, /* outgoing bytes */ + + IPVS_STATS_ATTR_CPS, /* current connection rate */ + IPVS_STATS_ATTR_INPPS, /* current in packet rate */ + IPVS_STATS_ATTR_OUTPPS, /* current out packet rate */ + IPVS_STATS_ATTR_INBPS, /* current in byte rate */ + IPVS_STATS_ATTR_OUTBPS, /* current out byte rate */ + __IPVS_STATS_ATTR_MAX, +}; + +#define IPVS_STATS_ATTR_MAX (__IPVS_STATS_ATTR_MAX - 1) + +/* Attributes used in response to IPVS_CMD_GET_INFO command */ +enum { + IPVS_INFO_ATTR_UNSPEC = 0, + IPVS_INFO_ATTR_VERSION, /* IPVS version number */ + IPVS_INFO_ATTR_CONN_TAB_SIZE, /* size of connection hash table */ + __IPVS_INFO_ATTR_MAX, +}; + +#define IPVS_INFO_ATTR_MAX (__IPVS_INFO_ATTR_MAX - 1) + +#endif /* _IP_VS_H */ --- keepalived-1.2.2.orig/debian/patches/02_dont_use_modprobe_k.patch +++ keepalived-1.2.2/debian/patches/02_dont_use_modprobe_k.patch @@ -0,0 +1,15 @@ +#don't use modprobe -k +#Sven Ulland +diff --git a/keepalived/check/ipvswrapper.c b/keepalived/check/ipvswrapper.c +index ad79f20..497d850 100644 +--- a/keepalived/check/ipvswrapper.c ++++ b/keepalived/check/ipvswrapper.c +@@ -687,7 +687,7 @@ string_to_number(const char *s, int min, int max) + static int + modprobe_ipvs(void) + { +- char *argv[] = { "/sbin/modprobe", "-s", "-k", "--", "ip_vs", NULL }; ++ char *argv[] = { "/sbin/modprobe", "-s", "--", "ip_vs", NULL }; + int child; + int status; + int rc; --- keepalived-1.2.2.orig/debian/patches/ubuntu_libnl3.patch +++ keepalived-1.2.2/debian/patches/ubuntu_libnl3.patch @@ -0,0 +1,108 @@ +Description: Support libnl version 2.0 and higher +Author: Marc - A. Dahlhaus +Forwarded: http://article.gmane.org/gmane.linux.keepalived.devel/3522 +Last-Update: 2011-12-21 + +diff -Nur -x '*.orig' -x '*~' keepalived/configure keepalived.new/configure +--- keepalived/configure 2011-12-15 22:11:52.353950000 -0500 ++++ keepalived.new/configure 2011-12-21 16:25:40.069869704 -0500 +@@ -3884,13 +3884,59 @@ + LIBS="$LIBS -lnl" + + else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_socket_alloc in -lnl" >&5 ++$as_echo_n "checking for nl_socket_alloc in -lnl... " >&6; } ++if ${ac_cv_lib_nl_nl_socket_alloc+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lnl $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char nl_socket_alloc (); ++int ++main () ++{ ++return nl_socket_alloc (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_nl_nl_socket_alloc=yes ++else ++ ac_cv_lib_nl_nl_socket_alloc=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nl_nl_socket_alloc" >&5 ++$as_echo "$ac_cv_lib_nl_nl_socket_alloc" >&6; } ++if test "x$ac_cv_lib_nl_nl_socket_alloc" = xyes; then : ++ ++ USE_NL="LIBIPVS_USE_NL" ++ CFLAGS="$CFLAGS -DLIBNL2" ++ LIBS="$LIBS -lnl-3 -lnl-genl-3" + +- USE_NL="LIBIPVS_DONTUSE_NL" +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: keepalived will be built without libnl support." >&5 ++else ++ ++ USE_NL="LIBIPVS_DONTUSE_NL" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: keepalived will be built without libnl support." >&5 + $as_echo "$as_me: WARNING: keepalived will be built without libnl support." >&2;} + + fi + ++ ++fi ++ + + CPPFLAGS="$CPPFLAGS -I$kernelinc" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel version" >&5 +diff -Nur -x '*.orig' -x '*~' keepalived/configure.in keepalived.new/configure.in +--- keepalived/configure.in 2011-12-15 22:11:52.353950000 -0500 ++++ keepalived.new/configure.in 2011-12-21 16:27:10.041874926 -0500 +@@ -56,9 +56,16 @@ + USE_NL="LIBIPVS_USE_NL" + LIBS="$LIBS -lnl" + ], +- [ +- USE_NL="LIBIPVS_DONTUSE_NL" +- AC_MSG_WARN([keepalived will be built without libnl support.]) ++ [AC_CHECK_LIB(nl-3, nl_socket_alloc, ++ [ ++ USE_NL="LIBIPVS_USE_NL" ++ CFLAGS="$CFLAGS -I/usr/include/libnl3 -DLIBNL2" ++ LIBS="$LIBS -lnl-3 -lnl-genl-3" ++ ], ++ [ ++ USE_NL="LIBIPVS_DONTUSE_NL" ++ AC_MSG_WARN([keepalived will be built without libnl support.]) ++ ]) + ]) + + dnl ----[ Kernel version check ]---- +diff -Nur -x '*.orig' -x '*~' keepalived/keepalived/libipvs-2.6/libipvs.c keepalived.new/keepalived/libipvs-2.6/libipvs.c +--- keepalived/keepalived/libipvs-2.6/libipvs.c 2011-12-15 22:11:52.353950000 -0500 ++++ keepalived.new/keepalived/libipvs-2.6/libipvs.c 2011-12-21 16:25:40.073869704 -0500 +@@ -34,6 +34,11 @@ + struct ip_vs_getinfo ipvs_info; + + #ifdef LIBIPVS_USE_NL ++# ifdef LIBNL2 ++# define nl_handle nl_sock ++# define nl_handle_alloc nl_socket_alloc ++# define nl_handle_destroy nl_socket_free ++# endif + struct nl_handle *sock = NULL; + int family, try_nl = 1; + #endif --- keepalived-1.2.2.orig/debian/patches/99_linux_2.6_compat.patch +++ keepalived-1.2.2/debian/patches/99_linux_2.6_compat.patch @@ -0,0 +1,13 @@ +diff -Nur keepalived-1.1.15/keepalived/vrrp/vrrp_arp.c keepalived-1.1.15.new/keepalived/vrrp/vrrp_arp.c +--- keepalived-1.1.15/keepalived/vrrp/vrrp_arp.c 2007-09-14 17:20:47.000000000 +0200 ++++ keepalived-1.1.15.new/keepalived/vrrp/vrrp_arp.c 2007-12-18 19:06:42.000000000 +0100 +@@ -22,6 +22,9 @@ + * Copyright (C) 2001-2007 Alexandre Cassen, + */ + ++/* Work around incompatibility between linux/types.h and sys/types.h */ ++#define __KERNEL_STRICT_NAMES ++ + /* local includes */ + #include "vrrp_arp.h" + #include "memory.h" --- keepalived-1.2.2.orig/debian/patches/0001-Set-correct-rights-on-PID-file.patch +++ keepalived-1.2.2/debian/patches/0001-Set-correct-rights-on-PID-file.patch @@ -0,0 +1,40 @@ +From 78aac2699469d610b5aa2f45dac4a30bd379938a Mon Sep 17 00:00:00 2001 +From: Vincent Bernat +Date: Tue, 10 May 2011 21:17:22 +0200 +Subject: [PATCH] Set correct rights on PID file. + +This file was writable by anybody, leading to the possibility of +writing any PID an waiting for some admin to restart keepalived to +kill the process of your choice. +--- + keepalived/core/pidfile.c | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/keepalived/core/pidfile.c b/keepalived/core/pidfile.c +index 383912e..0c3ea33 100644 +--- a/keepalived/core/pidfile.c ++++ b/keepalived/core/pidfile.c +@@ -20,6 +20,9 @@ + * Copyright (C) 2001-2011 Alexandre Cassen, + */ + ++#include ++#include ++#include + #include "logger.h" + #include "pidfile.h" + extern char *main_pidfile; +@@ -30,7 +33,9 @@ extern char *vrrp_pidfile; + int + pidfile_write(char *pid_file, int pid) + { +- FILE *pidfile = fopen(pid_file, "w"); ++ FILE *pidfile = NULL; ++ int pidfd = creat(pid_file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); ++ if (pidfd != -1) pidfile = fdopen(pidfd, "w"); + + if (!pidfile) { + log_message(LOG_INFO, "pidfile_write : Can not open %s pidfile", +-- +1.7.5.1 + --- keepalived-1.2.2.orig/debian/patches/04_fix_manpage.patch +++ keepalived-1.2.2/debian/patches/04_fix_manpage.patch @@ -0,0 +1,12 @@ +diff -Nur keepalived-1.1.13/doc/man/man5/keepalived.conf.5 keepalived-1.1.13.new/doc/man/man5/keepalived.conf.5 +--- keepalived-1.1.13/doc/man/man5/keepalived.conf.5 2005-02-07 02:24:59.000000000 +0100 ++++ keepalived-1.1.13.new/doc/man/man5/keepalived.conf.5 2007-07-25 08:13:33.000000000 +0200 +@@ -137,7 +137,7 @@ + Here are described two IPs (on inside_network and on outside_network), + on machine "my_hostname", which belong to the group VG_1 and + which will transition together on any state change. +-.PPa ++.PP + #You will need to write another block for outside_network. + vrrp_instance inside_network { + # Initial state, MASTER|BACKUP --- keepalived-1.2.2.orig/debian/patches/05_fix_address_comparison.patch +++ keepalived-1.2.2/debian/patches/05_fix_address_comparison.patch @@ -0,0 +1,15 @@ +## Description: Fix ipv4 address comparison routine +## Origin/Author: Adam Stokes +## Bug: https://bugs.launchpad.net/ubuntu/+source/keepalived/+bug/1211876 +diff -Nur -x '*.orig' -x '*~' keepalived-1.2.2/keepalived/include/check_data.h keepalived-1.2.2.new/keepalived/include/check_data.h +--- keepalived-1.2.2/keepalived/include/check_data.h 2011-05-29 06:19:59.000000000 -0400 ++++ keepalived-1.2.2.new/keepalived/include/check_data.h 2013-09-27 11:43:11.500379817 -0400 +@@ -163,7 +163,7 @@ + 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; + } --- keepalived-1.2.2.orig/debian/source/format +++ keepalived-1.2.2/debian/source/format @@ -0,0 +1 @@ +1.0