netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iproute2] iproute2:  Fix 'addr flush secondary' logic.
@ 2010-08-11 17:19 Ben Greear
  2010-08-11 20:41 ` Brian Haley
  0 siblings, 1 reply; 9+ messages in thread
From: Ben Greear @ 2010-08-11 17:19 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

It appears that the check for secondary v/s primary was reversed
when flushing addresses.  This caused:
ip addr flush dev eth0 secondary
to not actually flush anything.

This patch makes the check for IFA_F_SECONDARY match the
function names.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 5f0789c... 77b400d... M	ip/ipaddress.c
 ip/ipaddress.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 5f0789c..77b400d 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -637,7 +637,7 @@ int print_addrinfo_primary(const struct sockaddr_nl *who, struct nlmsghdr *n,
 {
 	struct ifaddrmsg *ifa = NLMSG_DATA(n);
 
-	if (!ifa->ifa_flags & IFA_F_SECONDARY)
+	if (ifa->ifa_flags & IFA_F_SECONDARY)
 		return 0;
 
 	return print_addrinfo(who, n, arg);
@@ -648,7 +648,7 @@ int print_addrinfo_secondary(const struct sockaddr_nl *who, struct nlmsghdr *n,
 {
 	struct ifaddrmsg *ifa = NLMSG_DATA(n);
 
-	if (ifa->ifa_flags & IFA_F_SECONDARY)
+	if (!ifa->ifa_flags & IFA_F_SECONDARY)
 		return 0;
 
 	return print_addrinfo(who, n, arg);
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-08-16 17:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-11 17:19 [iproute2] iproute2: Fix 'addr flush secondary' logic Ben Greear
2010-08-11 20:41 ` Brian Haley
2010-08-11 20:53   ` Ben Greear
2010-08-11 22:48   ` Ben Greear
2010-08-12 19:00     ` Brian Haley
2010-08-12 19:10       ` Ben Greear
2010-08-13 19:49       ` Ben Greear
2010-08-16 15:58         ` Brian Haley
2010-08-16 17:01           ` Ben Greear

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).