rpms/ucarp/FC-5 ucarp-1.2-arp.patch, NONE, 1.1 .cvsignore, 1.3, 1.4 carp.init, 1.1, 1.2 sources, 1.3, 1.4 ucarp.spec, 1.7, 1.8 vip-001.conf.example, 1.1, 1.2

Matthias Saou (thias) fedora-extras-commits at redhat.com
Fri Jun 30 13:25:02 UTC 2006


Author: thias

Update of /cvs/extras/rpms/ucarp/FC-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11492

Modified Files:
	.cvsignore carp.init sources ucarp.spec vip-001.conf.example 
Added Files:
	ucarp-1.2-arp.patch 
Log Message:
Backport 1.2 update + arp fix from devel branch.


ucarp-1.2-arp.patch:

--- NEW FILE ucarp-1.2-arp.patch ---
diff -Naupr ucarp-1.2.orig/src/carp.c ucarp-1.2/src/carp.c
--- ucarp-1.2.orig/src/carp.c	2006-02-19 00:06:17.000000000 +0100
+++ ucarp-1.2/src/carp.c	2006-06-22 11:59:46.000000000 +0200
@@ -637,6 +637,8 @@ int docarp(void)
 {
     struct bpf_program bpfp;
     struct pollfd pfds[1];
+    struct ifreq iface;
+    int fd;
     int nfds;
     char errbuf[PCAP_ERRBUF_SIZE];
 
@@ -703,7 +705,33 @@ int docarp(void)
     }
     carp_setrun(&sc, 0); 
     
+    if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) == -1) {
+        logfile(LOG_ERR, _("Error opening socket for interface [%s]: %s"),
+		interface == NULL ? "-" : interface, strerror(errno));
+        return -1;
+    }
+#ifdef SIOCGIFFLAGS    
+    if (strlen(interface) >= sizeof iface.ifr_name) {
+	logfile(LOG_ERR, _("Interface name too long"));
+	return -1;
+    }
+    strncpy(iface.ifr_name, interface, sizeof iface.ifr_name);
+#endif    
     for (;;) {
+#ifdef SIOCGIFFLAGS
+        if (ioctl(fd, SIOCGIFFLAGS, &iface) != 0) {
+	    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;
+	    sleep(SECONDS_TO_WAIT_AFTER_INTERFACE_IS_DOWN);
+	    continue;
+	}
+#endif
         nfds = poll(pfds, (nfds_t) 1, sc.sc_advbase * 1000);
         if (nfds == -1 || 
             (pfds[0].revents & (POLLERR | POLLHUP | POLLNVAL)) != 0) {
diff -Naupr ucarp-1.2.orig/src/ucarp.h ucarp-1.2/src/ucarp.h
--- ucarp-1.2.orig/src/ucarp.h	2004-08-28 18:10:28.000000000 +0200
+++ ucarp-1.2/src/ucarp.h	2006-06-22 11:59:33.000000000 +0200
@@ -210,6 +210,7 @@ struct carp_softc {
 #define CARP_AUTHLEN 7
 #define DEFAULT_ADVBASE 1U
 #define DEFAULT_DEAD_RATIO 3U
+#define SECONDS_TO_WAIT_AFTER_INTERFACE_IS_DOWN 10U
 
 #define DEFAULT_FACILITY LOG_DAEMON
 


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/ucarp/FC-5/.cvsignore,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- .cvsignore	13 Jan 2005 18:13:20 -0000	1.3
+++ .cvsignore	30 Jun 2006 13:25:02 -0000	1.4
@@ -1 +1 @@
-ucarp-1.1.tar.bz2
+ucarp-1.2.tar.bz2




Index: sources
===================================================================
RCS file: /cvs/extras/rpms/ucarp/FC-5/sources,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sources	13 Jan 2005 18:13:20 -0000	1.3
+++ sources	30 Jun 2006 13:25:02 -0000	1.4
@@ -1 +1 @@
-f907752bd1654a6e8aa42e717aee9774  ucarp-1.1.tar.bz2
+bed7ae84520f2e0faf3e68e9cfe4e1aa  ucarp-1.2.tar.bz2


Index: ucarp.spec
===================================================================
RCS file: /cvs/extras/rpms/ucarp/FC-5/ucarp.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ucarp.spec	6 Mar 2006 15:07:21 -0000	1.7
+++ ucarp.spec	30 Jun 2006 13:25:02 -0000	1.8
@@ -1,18 +1,26 @@
 Summary: Common Address Redundancy Protocol (CARP) for Unix
 Name: ucarp
-Version: 1.1
-Release: 5%{?dist}
+Version: 1.2
+Release: 2%{?dist}
 License: BSD
 Group: System Environment/Daemons
 URL: http://www.ucarp.org/
-Source0: ftp://ftp.ucarp.org/pub/ucarp/ucarp-%{version}.tar.bz2
+Source0: http://download.pureftpd.org/pub/ucarp/ucarp-%{version}.tar.bz2
 Source1: carp.init
 Source2: vip-001.conf.example
+Patch0: ucarp-1.2-arp.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 Requires(post): /sbin/chkconfig
 Requires(preun): /sbin/chkconfig, /sbin/service
 Requires(postun): /sbin/service
-BuildRequires: libpcap, gettext
+BuildRequires: gettext
+# Use libpcap up to FC5, and libpcap-devel for FC6+ and non-Fedora
+%if %{!?fedora:6}%{?fedora} >= 6
+BuildRequires: libpcap-devel
+%else
+BuildRequires: libpcap
+%endif
+
 
 %description
 UCARP allows a couple of hosts to share common virtual IP addresses in order
@@ -26,6 +34,7 @@
 
 %prep
 %setup
+%patch -p1 -b .arp
 
 
 %build
@@ -96,6 +105,14 @@
 
 
 %changelog
+* Thu Jun 22 2006 Matthias Saou <http://freshrpms.net/> 1.2-2
+- Include ARP patch backported from 1.3 snapshot (#196095).
+- Make libpcap build requirement conditional to be able to share spec file.
+
+* Wed Jun 21 2006 Matthias Saou <http://freshrpms.net/> 1.2-1
+- Update to 1.2.
+- BuildRequire libpcap-devel instead of libpcap now that it has been split.
+
 * Mon Mar  6 2006 Matthias Saou <http://freshrpms.net/> 1.1-5
 - FC5 rebuild.
 






More information about the fedora-extras-commits mailing list