* [PATCH] arping: Fix find_device_by_ifaddrs()
@ 2012-11-22 8:51 Jan Synacek
2012-11-26 9:26 ` Jan Synacek
0 siblings, 1 reply; 2+ messages in thread
From: Jan Synacek @ 2012-11-22 8:51 UTC (permalink / raw)
To: yoshfuji; +Cc: netdev, Jan Synacek
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] arping: Fix find_device_by_ifaddrs()
2012-11-22 8:51 [PATCH] arping: Fix find_device_by_ifaddrs() Jan Synacek
@ 2012-11-26 9:26 ` Jan Synacek
0 siblings, 0 replies; 2+ messages in thread
From: Jan Synacek @ 2012-11-26 9:26 UTC (permalink / raw)
To: yoshfuji; +Cc: netdev
On 11/22/2012 09:51 AM, Jan Synacek wrote:
> 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)
>
Please, disregard this patch. I found a problem with it and will send a proper
patch soon.
Cheers,
--
Jan Synacek
Software Engineer, BaseOS team Brno, Red Hat
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-26 9:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-22 8:51 [PATCH] arping: Fix find_device_by_ifaddrs() Jan Synacek
2012-11-26 9:26 ` Jan Synacek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).