rpms/iputils/devel iputils-20070202-arping_timeout.patch, NONE, 1.1 iputils.spec, 1.55, 1.56 iputils-20020927-12-arping.patch, 1.1, NONE
Martin Nagy (mnagy)
fedora-extras-commits at redhat.com
Mon Feb 18 14:20:20 UTC 2008
Author: mnagy
Update of /cvs/extras/rpms/iputils/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10113
Modified Files:
iputils.spec
Added Files:
iputils-20070202-arping_timeout.patch
Removed Files:
iputils-20020927-12-arping.patch
Log Message:
* Mon Feb 18 2008 Martin Nagy <mnagy at redhat.com> - 20070202-8
- correctly fix the -w option and return code of arping (#387881)
iputils-20070202-arping_timeout.patch:
--- NEW FILE iputils-20070202-arping_timeout.patch ---
diff -up iputils-s20070202/arping.c.test_patch iputils-s20070202/arping.c
--- iputils-s20070202/arping.c.test_patch 2007-02-02 13:55:46.000000000 +0100
+++ iputils-s20070202/arping.c 2008-02-14 14:57:19.000000000 +0100
@@ -44,7 +44,8 @@ struct in_addr src, dst;
char *target;
int dad, unsolicited, advert;
int quiet;
-int count=-1;
+int count;
+int forever = 1;
int timeout;
int unicasting;
int s;
@@ -53,7 +54,7 @@ int broadcast_only;
struct sockaddr_ll me;
struct sockaddr_ll he;
-struct timeval start, last;
+struct timeval last;
int sent, brd_sent;
int received, brd_recv, req_recv;
@@ -165,13 +166,15 @@ void catcher(void)
gettimeofday(&tv, NULL);
- if (start.tv_sec==0)
- start = tv;
-
- if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500))
- finish();
+ if (!forever && count == 0) {
+ if (timeout && MS_TDIFF(tv, last) > timeout * 1000 + 500)
+ finish();
+ else if (!timeout)
+ finish();
+ }
- if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
+ if ((count > 0 || forever) && (last.tv_sec == 0 || MS_TDIFF(tv, last) > 500)) {
+ count--;
send_pack(s, src, dst, &me, &he);
if (count == 0 && unsolicited)
finish();
@@ -332,6 +335,10 @@ main(int argc, char **argv)
break;
case 'c':
count = atoi(optarg);
+ if (count > 0)
+ forever = 0;
+ else
+ forever = 1;
break;
case 'w':
timeout = atoi(optarg);
@@ -514,7 +521,8 @@ main(int argc, char **argv)
sigaddset(&sset, SIGALRM);
sigaddset(&sset, SIGINT);
sigprocmask(SIG_BLOCK, &sset, &osset);
- recv_pack(packet, cc, &from);
+ if (recv_pack(packet, cc, &from) && count == 0 && !forever)
+ finish();
sigprocmask(SIG_SETMASK, &osset, NULL);
}
}
Index: iputils.spec
===================================================================
RCS file: /cvs/extras/rpms/iputils/devel/iputils.spec,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- iputils.spec 1 Feb 2008 10:38:18 -0000 1.55
+++ iputils.spec 18 Feb 2008 14:19:41 -0000 1.56
@@ -1,7 +1,7 @@
Summary: Network monitoring tools including ping
Name: iputils
Version: 20070202
-Release: 7%{?dist}
+Release: 8%{?dist}
License: BSD
URL: http://www.skbuff.net/iputils
Group: System Environment/Daemons
@@ -14,13 +14,13 @@
Patch5: iputils-20020927-ping-subint.patch
Patch9: iputils-20020927-unaligned.patch
Patch13: iputils-20020927-ia64_align.patch
-Patch15: iputils-20020927-12-arping.patch
Patch21: iputils-ping_cleanup.patch
Patch22: iputils-ifenslave.patch
Patch25: iputils-20020927-arping-infiniband.patch
Patch26: iputils-20070202-idn.patch
Patch27: iputils-20070202-open-max.patch
Patch28: iputils-20070202-traffic_class.patch
+Patch29: iputils-20070202-arping_timeout.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: docbook-utils perl-SGMLSpm
@@ -47,13 +47,13 @@
%patch5 -p1 -b .ping-subint
%patch9 -p1 -b .unaligned
%patch13 -p1 -b .align
-%patch15 -p1 -b .timeout
%patch21 -p1 -b .cleanup
%patch22 -p1 -b .addr
%patch25 -p1 -b .infiniband
%patch26 -p1 -b .idn
%patch27 -p1 -b .open-max
%patch28 -p1 -b .traffic_class
+%patch29 -p1 -b .arping_timeout
%build
%ifarch s390 s390x
@@ -154,6 +154,9 @@
%{_sysconfdir}/rc.d/init.d/rdisc
%changelog
+* Mon Feb 18 2008 Martin Nagy <mnagy at redhat.com> - 20070202-8
+- correctly fix the -w option and return code of arping (#387881)
+
* Fri Feb 01 2008 Martin Nagy <mnagy at redhat.com> - 20070202-7
- fix -Q option of ping6 (#213544)
--- iputils-20020927-12-arping.patch DELETED ---
More information about the fedora-extras-commits
mailing list