rpms/ucarp/devel ucarp-1.2-arp.patch, NONE, 1.1 carp.init, 1.1, 1.2 ucarp.spec, 1.8, 1.9 vip-001.conf.example, 1.1, 1.2
Matthias Saou (thias)
fedora-extras-commits at redhat.com
Thu Jun 22 10:05:17 UTC 2006
Author: thias
Update of /cvs/extras/rpms/ucarp/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15329
Modified Files:
carp.init ucarp.spec vip-001.conf.example
Added Files:
ucarp-1.2-arp.patch
Log Message:
Include fix for ARP problem (#196095).
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: ucarp.spec
===================================================================
RCS file: /cvs/extras/rpms/ucarp/devel/ucarp.spec,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ucarp.spec 20 Jun 2006 22:55:39 -0000 1.8
+++ ucarp.spec 22 Jun 2006 10:05:17 -0000 1.9
@@ -1,18 +1,26 @@
Summary: Common Address Redundancy Protocol (CARP) for Unix
Name: ucarp
Version: 1.2
-Release: 1%{?dist}
+Release: 2%{?dist}
License: BSD
Group: System Environment/Daemons
URL: http://www.ucarp.org/
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-devel, 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,10 @@
%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.
More information about the fedora-extras-commits
mailing list