Fix arping's default device search logic

This commit is contained in:
Jan Synacek 2012-11-22 10:11:32 +01:00
parent 7fbf8172b3
commit a0b7493711
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,35 @@
From 99e2651c08f6d4ac63fc9d8e4d11f680fa5cc274 Mon Sep 17 00:00:00 2001
From: Jan Synacek <jsynacek@redhat.com>
Date: Thu, 22 Nov 2012 09:42:51 +0100
Subject: [PATCH] arping: Fix find_device_by_ifaddrs()
Look for another device if the device name and the currently found one are the
same, not different.
Also, make checking for the device's flags nonfatal.
Signed-off-by: Jan Synacek <jsynacek@redhat.com>
---
arping.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arping.c b/arping.c
index ff77bec..d0edccf 100644
--- a/arping.c
+++ b/arping.c
@@ -550,10 +550,10 @@ static int find_device_by_ifaddrs(void)
continue;
if (ifa->ifa_addr->sa_family != AF_PACKET)
continue;
- if (device.name && ifa->ifa_name && strcmp(ifa->ifa_name, device.name))
+ if (device.name && ifa->ifa_name && !strcmp(ifa->ifa_name, device.name))
continue;
- if (check_ifflags(ifa->ifa_flags, device.name != NULL) < 0)
+ if (check_ifflags(ifa->ifa_flags, 0) < 0)
continue;
if (!((struct sockaddr_ll *)ifa->ifa_addr)->sll_halen)
--
1.7.11.7

View File

@ -21,6 +21,7 @@ Patch3: iputils-ifenslave.patch
Patch4: iputils-20121112-idn.patch
Patch5: iputils-20071127-corr_type.patch
Patch6: iputils-20100418-convtoint.patch
Patch7: iputils-20121121-ifaddrs.patch
BuildRequires: docbook-utils perl-SGMLSpm
BuildRequires: glibc-kernheaders >= 2.4-8.19
@ -65,6 +66,7 @@ The iputils-sysvinit contains SysV initscritps support.
%patch4 -p1 -b .idn
%patch5 -p1 -b .corr_type
%patch6 -p1 -b .convtoint
%patch7 -p1 -b .ifaddrs
%build
%ifarch s390 s390x
@ -151,6 +153,7 @@ mv -f RELNOTES.tmp RELNOTES
- Update to iputils-s20121121, drop unnecessary patches
- Add capabilities to clockdiff and arping
- Renumber patches
- Fix arping's default device search logic
* Mon Nov 19 2012 Jan Synáček <jsynacek@redhat.com> - 20121112-2
- Update License field