[iputils/f12/master] * Tue Oct 12 2010 Jiri Skala <jskala at redhat.com> - 20071127-13 - fixes #642005 - arping -c option br

Jiri Skala jskala at fedoraproject.org
Tue Oct 12 08:52:25 UTC 2010


commit 8254b7a24b7ded759d876727744ee18ce59ba541
Author: Jiri Skala <jskala at localhost.(none)>
Date:   Tue Oct 12 10:52:33 2010 +0200

    * Tue Oct 12 2010 Jiri Skala <jskala at redhat.com> - 20071127-13
    - fixes #642005 - arping -c option broken for even numbers, even worse when combined with -w

 iputils-20071127-timeout.patch |   28 ++++++++++++++++++----------
 iputils.spec                   |    5 ++++-
 2 files changed, 22 insertions(+), 11 deletions(-)
---
diff --git a/iputils-20071127-timeout.patch b/iputils-20071127-timeout.patch
index a821bd0..278d5c1 100644
--- a/iputils-20071127-timeout.patch
+++ b/iputils-20071127-timeout.patch
@@ -1,17 +1,18 @@
 diff -up iputils-s20071127/arping.c.timeout iputils-s20071127/arping.c
---- iputils-s20071127/arping.c.timeout	2010-03-04 17:29:38.723487588 +0100
-+++ iputils-s20071127/arping.c	2010-03-04 17:36:32.586489670 +0100
-@@ -44,8 +44,7 @@ struct in_addr src, dst;
+--- iputils-s20071127/arping.c.timeout	2010-10-12 10:26:27.143223507 +0200
++++ iputils-s20071127/arping.c	2010-10-12 10:28:15.763965275 +0200
+@@ -44,8 +44,8 @@ struct in_addr src, dst;
  char *target;
  int dad, unsolicited, advert;
  int quiet;
 -int count;
 -int forever = 1;
 +int count=-1;
++int arg_count=-1;
  int timeout;
  int unicasting;
  int s;
-@@ -59,10 +58,10 @@ int broadcast_only;
+@@ -59,10 +59,10 @@ int broadcast_only;
  struct sockaddr_ll me[2];
  struct sockaddr_ll he[2];
  
@@ -24,7 +25,7 @@ diff -up iputils-s20071127/arping.c.timeout iputils-s20071127/arping.c
  
  #define SYSFS_MNT_PATH          "/sys"
  #define SYSFS_CLASS             "class"
-@@ -179,14 +178,14 @@ void catcher(void)
+@@ -179,19 +179,21 @@ void catcher(void)
  
  	gettimeofday(&tv, NULL);
  
@@ -46,26 +47,33 @@ diff -up iputils-s20071127/arping.c.timeout iputils-s20071127/arping.c
  		count--;
  		send_pack(s, src, dst, &me[0], &he[0]);
  		if (count == 0 && unsolicited)
-@@ -405,10 +404,6 @@ main(int argc, char **argv)
+ 			finish();
+ 	}
++	if (received == arg_count)
++		finish();
+ 	alarm(1);
+ }
+ 
+@@ -404,11 +406,7 @@ main(int argc, char **argv)
+ 			quiet++;
  			break;
  		case 'c':
- 			count = atoi(optarg);
+-			count = atoi(optarg);
 -			if (count > 0)
 -				forever = 0;
 -			else
 -				forever = 1;
++			arg_count = count = atoi(optarg);
  			break;
  		case 'w':
  			timeout = atoi(optarg);
-@@ -610,8 +605,9 @@ main(int argc, char **argv)
+@@ -610,8 +608,7 @@ main(int argc, char **argv)
  		sigaddset(&sset, SIGALRM);
  		sigaddset(&sset, SIGINT);
  		sigprocmask(SIG_BLOCK, &sset, &osset);
 -		if (recv_pack(packet, cc, from) && count == 0 && !forever)
 -			finish();
 +		recv_pack(packet, cc, &from[0]);
-+		if(received == count)
-+			exit(0);
  		sigprocmask(SIG_SETMASK, &osset, NULL);
  	}
  }
diff --git a/iputils.spec b/iputils.spec
index befd6e2..1329231 100644
--- a/iputils.spec
+++ b/iputils.spec
@@ -1,7 +1,7 @@
 Summary: Network monitoring tools including ping
 Name: iputils
 Version: 20071127
-Release: 12%{?dist}
+Release: 13%{?dist}
 License: BSD
 URL: http://www.skbuff.net/iputils
 Group: System Environment/Daemons
@@ -156,6 +156,9 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_sysconfdir}/rc.d/init.d/rdisc
 
 %changelog
+* Tue Oct 12 2010 Jiri Skala <jskala at redhat.com> - 20071127-13
+- fixes #642005 - arping -c option broken for even numbers, even worse when combined with -w
+
 * Thu Aug 05 2010 Jiri Skala <jskala at redhat.com> - 20071127-12
 - fixes #617613 - CVE-2010-2529 iputils: denial of service vulnerability in ping
 


More information about the scm-commits mailing list