[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Freeze exception for ucarp_1.5-2



I know it is the release team's policy not to allow new upstreams
during the freeze, but I'm hoping an exception can be made for ucarp.

The current version in testing is a snapshot and very little changed
between it and the official release. Backporting the changes necessary
to fix #496625 (severity serious) is trivial, but the resulting 
package differs very little from what is currently in unstable.

I've attached diffs of 1.5~snap080222-1 to 1.5-2, and 1.5~snap080222-1
to a 1.5~snap080222-2 with backported fixes, (sans generated files).

Thanks,

-- 
Eric Evans
eevans@debian.org
diff -Nru ucarp-1.5~snap080222/AUTHORS ucarp-1.5/AUTHORS
--- ucarp-1.5~snap080222/AUTHORS	2008-01-21 03:41:34.000000000 -0600
+++ ucarp-1.5/AUTHORS	2008-07-31 03:00:14.000000000 -0500
@@ -7,4 +7,6 @@
 * Dean Gaudet <dean@arctic.org> - EINTR handling, log exec errors, --passfile.
 * Steve Kehlet and Marcus Goller - fixed the bogus code that issued poisonous
 gratuitous ARP, and improved the behavior when multiple nodes are started
-with the same interval and skew.
+with the same interval and skew. Steve helped a lot on many things.
+* Tim Niemeyer <niemeyer@kdo.de> - Ensure remastering works when the
+preferred master has its network connection flap.
diff -Nru ucarp-1.5~snap080222/ChangeLog ucarp-1.5/ChangeLog
--- ucarp-1.5~snap080222/ChangeLog	2008-02-22 08:44:55.000000000 -0600
+++ ucarp-1.5/ChangeLog	2008-07-31 03:02:26.000000000 -0500
@@ -1,14 +1,24 @@
 * Version 1.5:
  - Have ucarp register for the VRRP multicast group, by Petr Kohts.
- 
+ - Selection of master improved, by Greg Walton.
+ - New option, -S (--ignoreifstate) to ignore unplugged network cable
+detection, for NICs that don't support that feature.
+ - -o is now working as an alternative to --passfile, thanks to Eric Evans. 
+ - Have a degraded master send a last advertisement because if its network
+link gets cut and uncut, it doesn't know that the slave has taken the master
+role. Contributed by Tim Niemeyer.
+
 * Version 1.4:
  - --xparam shortcut is -m, not -x. Thanks fo Fabrice Dulaunoy.
  - Use multicast destination address for advertisements instead of
 broadcasts. Required for some switches. Fabrice Dulaunoy.
  - gettext upgrade.
- - Introduce a random backoff sleep in order to avoid flip-flop when
-multiples nodes are started with the same parameters. By Steve Kehlet.
- - Removed bogus gratuitous ARP code. By Marcus Goller.
+ - Host with the lower IP address wit hnow be elected master when multiples
+nodes are started with the same parameters, in order to avoid flip-flop.
+By Steve Kehlet.
+ - Improved gratuitous ARP payload for better interoperability, by Steve
+Kehlet.
+ - Removed bogus gratuitous ARP code. Initial report by Marcus Goller.
  - Documentation updates, by Steve Kehlet.
 
 * Version 1.3:
diff -Nru ucarp-1.5~snap080222/debian/changelog ucarp-1.5/debian/changelog
--- ucarp-1.5~snap080222/debian/changelog	2008-08-29 13:26:13.000000000 -0500
+++ ucarp-1.5/debian/changelog	2008-08-29 13:26:13.000000000 -0500
@@ -1,3 +1,15 @@
+ucarp (1.5-2) unstable; urgency=low
+
+  * Documented new -S/--ignoreifstate option.
+
+ -- Eric Evans <eevans@debian.org>  Wed, 27 Aug 2008 11:55:36 -0500
+
+ucarp (1.5-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Eric Evans <eevans@debian.org>  Mon, 25 Aug 2008 15:41:13 -0500
+
 ucarp (1.5~snap080222-1) unstable; urgency=low
 
   * New upstream version, (Closes: #473662). This version introduces
diff -Nru ucarp-1.5~snap080222/debian/control ucarp-1.5/debian/control
--- ucarp-1.5~snap080222/debian/control	2008-08-29 13:26:13.000000000 -0500
+++ ucarp-1.5/debian/control	2008-08-29 13:26:13.000000000 -0500
@@ -4,9 +4,9 @@
 Maintainer: Eric Evans <eevans@debian.org>
 Build-Depends: debhelper (>= 4.0.0), libpcap-dev (>= 0.7.2), docbook-to-man (>= 1:2.0.0)
 Homepage: http://ucarp.org
-Vcs-Git: git://git.debian.org/git/users/eevans/ucarp
-Vcs-Browser: http://git.debian.org/?p=users/eevans/ucarp
-Standards-Version: 3.7.3
+Vcs-Git: git://git.debian.org/git/users/eevans/ucarp.git
+Vcs-Browser: http://git.debian.org/?p=users/eevans/ucarp.git
+Standards-Version: 3.8.0
 
 Package: ucarp
 Architecture: any
diff -Nru ucarp-1.5~snap080222/debian/NEWS ucarp-1.5/debian/NEWS
--- ucarp-1.5~snap080222/debian/NEWS	2008-08-29 13:26:13.000000000 -0500
+++ ucarp-1.5/debian/NEWS	2008-08-29 13:26:13.000000000 -0500
@@ -1,3 +1,13 @@
+ucarp (1.5-2) unstable; urgency=low
+
+  This version introduces support for ignoring interface state
+  through the use of the -S/--ignoreifstate option. This is useful
+  when nodes are connected by a crossover cable where powering down
+  one node will drop the link of the other, causing an unwanted
+  transition to backup on the remaining node.
+
+ -- Eric Evans <eevans@debian.org>  Tue, 26 Aug 2008 16:43:06 -0500
+
 ucarp (1.5~snap080222-1) unstable; urgency=low
 
   Ucarp supports two new arguments.
diff -Nru ucarp-1.5~snap080222/debian/README.Debian ucarp-1.5/debian/README.Debian
--- ucarp-1.5~snap080222/debian/README.Debian	2008-08-29 13:26:13.000000000 -0500
+++ ucarp-1.5/debian/README.Debian	2008-08-29 13:26:13.000000000 -0500
@@ -11,7 +11,7 @@
 	ucarp-vip 10.0.0.1
 	ucarp-password 16charsatmost
 	ucarp-advskew 0
-	ucarp advbase 1
+	ucarp-advbase 1
 	ucarp-master yes
 iface eth0:ucarp inet static
 	address 10.0.0.1
@@ -29,4 +29,4 @@
 ucarp-downscript options. Note that you must ensure your scripts take
 care of bringing the virtual IP up and down if you do this.
 
- -- Eric Evans <eevans@sym-link.com>, Fri, 30 Apr 2004 01:50:44 +0000
+ -- Eric Evans <eevans@debian.org>  Mon, 25 Aug 2008 20:40:09 -0500
diff -Nru ucarp-1.5~snap080222/debian/ucarp.8.sgml ucarp-1.5/debian/ucarp.8.sgml
--- ucarp-1.5~snap080222/debian/ucarp.8.sgml	2008-08-29 13:26:13.000000000 -0500
+++ ucarp-1.5/debian/ucarp.8.sgml	2008-08-29 13:26:13.000000000 -0500
@@ -83,6 +83,7 @@
       <arg><option>-B, --daemonize</option></arg>
       <arg><option>-f, --facility=<replaceable>FACILITY</replaceable></option></arg>
       <arg><option>-x, --xparam <replaceable>PARAM</replaceable</option></arg>
+      <arg><option>-S, --ignoreifstate</option></arg>
       </cmdsynopsis>
   </refsynopsisdiv>
 
@@ -198,21 +199,21 @@
         </listitem>
       </varlistentry>
       <varlistentry>
-        <term><option>-z </option><option> --shutdown</option></term>
+        <term><option>-z</option><option> --shutdown</option></term>
         <listitem>
           <para>Use of this command causes the command specified by the -d 
           argument to be invoked when ucarp shuts down.</para>
         </listitem>
       </varlistentry>
       <varlistentry>
-        <term><option>-B </option><option> --daemonize</option></term>
+        <term><option>-B</option><option> --daemonize</option></term>
         <listitem>
           <para>Causes &dhpackage; to detach from the terminal and run in the
           background as a daemon.</para>
         </listitem>
       </varlistentry>
       <varlistentry>
-        <term><option>-f </option><option> --facility</option></term>
+        <term><option>-f</option><option> --facility</option></term>
         <listitem>
           <para>Set the syslog facility, defaults to daemon.</para>
         </listitem>
@@ -224,6 +225,16 @@
           scripts.</para>
         </listitem>
       </varlistentry>
+      <varlistentry>
+        <term><option>-S</option><option> --ignoreifstate</option></term>
+        <listitem>
+          <para>Ignore unplugged network cables. This option is useful when
+          &dhpackage; nodes are connected with a crossover cable. Without
+          this option the master will transition to backup when the other
+          node is powered down, as it no longer has a link (NO-CARRIER).
+          </para>
+        </listitem>
+      </varlistentry>
     </variablelist>
   </refsect1>
 
diff -Nru ucarp-1.5~snap080222/NEWS ucarp-1.5/NEWS
--- ucarp-1.5~snap080222/NEWS	2008-02-22 07:56:23.000000000 -0600
+++ ucarp-1.5/NEWS	2008-05-06 05:43:37.000000000 -0500
@@ -1,4 +1,8 @@
 * Version 1.5:
+ - Breakage introducted with version 1.4 should finally be fixed, thanks to
+Petr Kohts, Greg Walton and Steve Kehlet.
+ - A new option has been added to ignore unplugged network cable detection,
+useful when nodes are connected with a crossover cable, not with a switch.
 
 * Version 1.4:
  - This version should finally fix every issue people had with gratuitous
diff -Nru ucarp-1.5~snap080222/README ucarp-1.5/README
--- ucarp-1.5~snap080222/README	2008-02-22 07:56:26.000000000 -0600
+++ ucarp-1.5/README	2008-05-06 05:44:34.000000000 -0500
@@ -218,6 +218,14 @@
 other masters and promote itself if necessary.  This could be useful if
 you wish another node to take over master.
 
+--ignoreifstate (-S) option tells ucarp to ignore unplugged network cable. It 
+is useful when you connect ucarp nodes with a crossover patch cord (not via a 
+hub or a switch). Without this option the node in MASTER state will switch to
+BACKUP state when the other node is powered down, because network interface 
+shows that cable is unplugged (NO-CARRIER). Some network interface drivers 
+don't support NO-CARRIER feature, and this option is not needed for these 
+network cards. The card that definitely supports this feature is Realtek 8139.
+
 
         ------------------------ TRANSLATIONS ------------------------
 
diff -Nru ucarp-1.5~snap080222/src/carp.c ucarp-1.5/src/carp.c
--- ucarp-1.5~snap080222/src/carp.c	2008-08-29 13:26:13.000000000 -0500
+++ ucarp-1.5/src/carp.c	2008-08-29 13:26:13.000000000 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2007 Frank Denis. All rights reserved.
+ * Copyright (c) 2004-2008 Frank Denis. All rights reserved.
  * 
  * This crucial part of UCARP is derived from the OpenBSD project.
  * Original copyright follows. 
@@ -569,6 +569,10 @@
             if (timercmp(&sc_tv, &ch_tv, >) ||
                 (timercmp(&sc_tv, &ch_tv, ==) &&
                  iphead.ip_src.s_addr < srcip.s_addr)) {
+		/* To be really sure the new master knows that is
+		 * has to reassert control of the VIP */
+		carp_send_ad(&sc);
+		
                 carp_set_state(&sc, BACKUP);
                 carp_setrun(&sc, 0);
                 logfile(LOG_WARNING, _("Preferred master advertised: "
@@ -577,18 +581,19 @@
 
             /*
              * If we receive an advertisement from a master who's advertising
-             * with the same frequency as us but with a higher IP address,
-             * reassert our dominance by issuing another gratuitous arp.
+             * less frequently than us, or with the same frequency as us but
+             * with a higher IP address, reassert our dominance by issuing
+             * another gratuitous arp.
              */
-            if (timercmp(&sc_tv, &ch_tv, ==) &&
-                iphead.ip_src.s_addr > srcip.s_addr) {
-                gratuitous_arp(dev_desc_fd);
-                sc.sc_delayed_arp = 2; /* and yet another in 2 ticks */
-                logfile(LOG_WARNING, _("Non-preferred master advertising: "
-                                       "reasserting control of VIP with another gratuitous arp"));
+            if (timercmp(&sc_tv, &ch_tv, <) ||
+                (timercmp(&sc_tv, &ch_tv, ==) &&
+		 iphead.ip_src.s_addr > srcip.s_addr)) {
+		gratuitous_arp(dev_desc_fd);
+		sc.sc_delayed_arp = 2; /* and yet another in 2 ticks */
+		logfile(LOG_WARNING, _("Non-preferred master advertising: "
+				       "reasserting control of VIP with another gratuitous arp"));
             }
-
-            break;
+	    break;
         case BACKUP:
             /*
              * If we're pre-empting masters who advertise slower than us,
@@ -754,14 +759,14 @@
     }
     memset(&req_add, 0, sizeof req_add);
     req_add.imr_multiaddr.s_addr = inet_addr("224.0.0.18");
-    req_add.imr_interface.s_addr = htonl(INADDR_ANY);
+    req_add.imr_interface.s_addr = srcip.s_addr;
     if (setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
 		   &req_add, sizeof req_add) < 0) {
 	logfile(LOG_ERR, "Can't do IP_ADD_MEMBERSHIP errno=%s (%d)",
 		strerror(errno), errno);
 	close(fd);
 	return -1;
-    }   
+    }
 #ifdef SIOCGIFFLAGS    
     if (strlen(interface) >= sizeof iface.ifr_name) {
         logfile(LOG_ERR, _("Interface name too long"));
@@ -775,16 +780,18 @@
             break;
         }
         if ((iface.ifr_flags & IFF_RUNNING) == 0) {
-            carp_set_state(&sc, BACKUP);
-            sc.sc_ad_tmo.tv_sec = 0;
-            sc.sc_ad_tmo.tv_usec = 0;
-            sc.sc_md_tmo.tv_sec = 0;
-            sc.sc_md6_tmo.tv_usec = 0;
-            if (iface_running) {
-                iface_running = 0;
-            }
-            sleep(SECONDS_TO_WAIT_AFTER_INTERFACE_IS_DOWN);
-            continue;
+	    if (ignoreifstate == 0) {
+		carp_set_state(&sc, BACKUP);
+		sc.sc_ad_tmo.tv_sec = 0;
+		sc.sc_ad_tmo.tv_usec = 0;
+		sc.sc_md_tmo.tv_sec = 0;
+		sc.sc_md6_tmo.tv_usec = 0;
+        	if (iface_running) {
+		    iface_running = 0;
+		}
+		sleep(SECONDS_TO_WAIT_AFTER_INTERFACE_IS_DOWN);
+		continue;
+	    }
         } else {
             if (!iface_running) {
                 iface_running = 1;
diff -Nru ucarp-1.5~snap080222/src/globals.h ucarp-1.5/src/globals.h
--- ucarp-1.5~snap080222/src/globals.h	2008-01-19 16:57:59.000000000 -0600
+++ ucarp-1.5/src/globals.h	2008-05-06 05:44:14.000000000 -0500
@@ -25,6 +25,7 @@
 GLOBAL0(unsigned char hwaddr[6]);
 GLOBAL0(signed char no_syslog);
 GLOBAL0(signed char daemonize);
+GLOBAL0(signed char ignoreifstate);
 GLOBAL(int syslog_facility, DEFAULT_FACILITY);
 GLOBAL0(char *vaddr_arg);
 GLOBAL0(char *xparam);
diff -Nru ucarp-1.5~snap080222/src/Makefile.in ucarp-1.5/src/Makefile.in
diff -Nru ucarp-1.5~snap080222/src/ucarp.c ucarp-1.5/src/ucarp.c
--- ucarp-1.5~snap080222/src/ucarp.c	2008-01-19 16:19:43.000000000 -0600
+++ ucarp-1.5/src/ucarp.c	2008-05-06 05:46:57.000000000 -0500
@@ -39,6 +39,7 @@
 	    "--deadratio=<ratio> (-r <ratio>): ratio to consider a host as dead\n"
 	    "--shutdown (-z): call shutdown script at exit\n"
 	    "--daemonize (-B): run in background\n"
+	    "--ignoreifstate (-S): ignore interface state (down, no carrier)\n"
 	    "--facility=<facility> (-f): set syslog facility (default=daemon)\n"
 	    "--xparam=<value> (-x): extra parameter to send to up/down scripts\n"	    
 	    "\n"
@@ -203,9 +204,13 @@
             daemonize = 1;
             break;
         }
+	case 'S': {
+	    ignoreifstate = 1;
+	    break;
+	}
         case 'f': {
             int n = 0;
-
+	    
             if (strcasecmp(optarg, "none") == 0) {
                 no_syslog = 1;
                 break;
diff -Nru ucarp-1.5~snap080222/src/ucarp_p.h ucarp-1.5/src/ucarp_p.h
--- ucarp-1.5~snap080222/src/ucarp_p.h	2008-08-29 13:26:13.000000000 -0500
+++ ucarp-1.5/src/ucarp_p.h	2008-08-29 13:26:13.000000000 -0500
@@ -1,7 +1,7 @@
 #ifndef __CARP_P_H__
 #define __CARP_P_H__ 1
 
-static const char *GETOPT_OPTIONS = "i:s:v:p:Pa:hb:k:x:nu:d:r:zf:Bo:";
+static const char *GETOPT_OPTIONS = "i:s:v:p:Pa:hb:k:x:nu:d:r:zf:Bo:S";
 
 static struct option long_options[] = {
     { "interface", 1, NULL, 'i' },
@@ -20,6 +20,7 @@
     { "shutdown", 0, NULL, 'z' },
     { "facility", 1, NULL, 'f' },
     { "daemonize", 0, NULL, 'B' },
+    { "ignoreifstate", 0, NULL, 'S' },
     { "passfile", 1, NULL, 'o' },
     { "xparam", 1, NULL, 'x' },
     { NULL, 0, NULL, 0 }
diff -u ucarp-1.5~snap080222/src/carp.c ucarp-1.5~snap080222/src/carp.c
--- ucarp-1.5~snap080222/src/carp.c
+++ ucarp-1.5~snap080222/src/carp.c
@@ -569,6 +569,10 @@
             if (timercmp(&sc_tv, &ch_tv, >) ||
                 (timercmp(&sc_tv, &ch_tv, ==) &&
                  iphead.ip_src.s_addr < srcip.s_addr)) {
+		/* To be really sure the new master knows that is
+		 * has to reassert control of the VIP */
+		carp_send_ad(&sc);
+
                 carp_set_state(&sc, BACKUP);
                 carp_setrun(&sc, 0);
                 logfile(LOG_WARNING, _("Preferred master advertised: "
@@ -577,18 +581,19 @@
 
             /*
              * If we receive an advertisement from a master who's advertising
-             * with the same frequency as us but with a higher IP address,
-             * reassert our dominance by issuing another gratuitous arp.
+             * less frequently than us, or with the same frequency as us but
+             * with a higher IP address, reassert our dominance by issuing
+             * another gratuitous arp.
              */
-            if (timercmp(&sc_tv, &ch_tv, ==) &&
-                iphead.ip_src.s_addr > srcip.s_addr) {
-                gratuitous_arp(dev_desc_fd);
-                sc.sc_delayed_arp = 2; /* and yet another in 2 ticks */
-                logfile(LOG_WARNING, _("Non-preferred master advertising: "
-                                       "reasserting control of VIP with another gratuitous arp"));
+            if (timercmp(&sc_tv, &ch_tv, <) ||
+                (timercmp(&sc_tv, &ch_tv, ==) &&
+		 iphead.ip_src.s_addr > srcip.s_addr)) {
+		gratuitous_arp(dev_desc_fd);
+		sc.sc_delayed_arp = 2; /* and yet another in 2 ticks */
+		logfile(LOG_WARNING, _("Non-preferred master advertising: "
+				       "reasserting control of VIP with another gratuitous arp"));
             }
-
-            break;
+	    break;
         case BACKUP:
             /*
              * If we're pre-empting masters who advertise slower than us,
@@ -754,14 +759,14 @@
     }
     memset(&req_add, 0, sizeof req_add);
     req_add.imr_multiaddr.s_addr = inet_addr("224.0.0.18");
-    req_add.imr_interface.s_addr = htonl(INADDR_ANY);
+    req_add.imr_interface.s_addr = srcip.s_addr;
     if (setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
 		   &req_add, sizeof req_add) < 0) {
 	logfile(LOG_ERR, "Can't do IP_ADD_MEMBERSHIP errno=%s (%d)",
 		strerror(errno), errno);
 	close(fd);
 	return -1;
-    }   
+    }
 #ifdef SIOCGIFFLAGS    
     if (strlen(interface) >= sizeof iface.ifr_name) {
         logfile(LOG_ERR, _("Interface name too long"));
diff -u ucarp-1.5~snap080222/debian/changelog ucarp-1.5~snap080222/debian/changelog
--- ucarp-1.5~snap080222/debian/changelog
+++ ucarp-1.5~snap080222/debian/changelog
@@ -1,3 +1,10 @@
+ucarp (1.5~snap080222-2) unstable; urgency=low
+
+  * Backported changes from 1.5 to correct a bug that would cause
+    all nodes to assert master in certain configs (Closes: #496625).
+
+ -- Eric Evans <eevans@debian.org>  Thu, 28 Aug 2008 13:32:54 -0500
+
 ucarp (1.5~snap080222-1) unstable; urgency=low
 
   * New upstream version, (Closes: #473662). This version introduces
diff -u ucarp-1.5~snap080222/debian/control ucarp-1.5~snap080222/debian/control
--- ucarp-1.5~snap080222/debian/control
+++ ucarp-1.5~snap080222/debian/control
@@ -4,8 +4,8 @@
 Maintainer: Eric Evans <eevans@debian.org>
 Build-Depends: debhelper (>= 4.0.0), libpcap-dev (>= 0.7.2), docbook-to-man (>= 1:2.0.0)
 Homepage: http://ucarp.org
-Vcs-Git: git://git.debian.org/git/users/eevans/ucarp
-Vcs-Browser: http://git.debian.org/?p=users/eevans/ucarp
+Vcs-Git: git://git.debian.org/git/users/eevans/ucarp.git
+Vcs-Browser: http://git.debian.org/?p=users/eevans/ucarp.git
 Standards-Version: 3.7.3
 
 Package: ucarp

Attachment: signature.asc
Description: Digital signature


Reply to: