[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1400785037-9963-1-git-send-email-xiyou.wangcong@gmail.com>
Date: Thu, 22 May 2014 11:57:17 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: jet.chen@...el.com, "David S. Miller" <davem@...emloft.net>,
Steffen Klassert <steffen.klassert@...unet.com>,
Antonio Quartulli <antonio@...n-mesh.com>,
Marek Lindner <mareklindner@...mailbox.ch>,
Cong Wang <xiyou.wangcong@...il.com>,
Cong Wang <cwang@...pensource.com>
Subject: [Patch net] batman: fix a bogus warning from batadv_is_on_batman_iface()
From: Cong Wang <cwang@...pensource.com>
batman tries to search dev->iflink to check if it's a batman interface,
but ->iflink could be 0, which is not a valid ifindex. It should just
avoid iflink == 0 case.
Reported-by: Jet Chen <jet.chen@...el.com>
Tested-by: Jet Chen <jet.chen@...el.com>
Cc: David S. Miller <davem@...emloft.net>
Cc: Steffen Klassert <steffen.klassert@...unet.com>
Cc: Antonio Quartulli <antonio@...n-mesh.com>
Cc: Marek Lindner <mareklindner@...mailbox.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
Signed-off-by: Cong Wang <cwang@...pensource.com>
---
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index b851cc5..fbda6b5 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -83,7 +83,7 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev)
return true;
/* no more parents..stop recursion */
- if (net_dev->iflink == net_dev->ifindex)
+ if (net_dev->iflink == 0 || net_dev->iflink == net_dev->ifindex)
return false;
/* recurse over the parent device */
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists