Skip to content

Commit b6ed549

Browse files
congwang1986davem330
authored andcommitted
batman: fix a bogus warning from batadv_is_on_batman_iface()
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@intel.com> Tested-by: Jet Chen <jet.chen@intel.com> Cc: David S. Miller <davem@davemloft.net> Cc: Steffen Klassert <steffen.klassert@secunet.com> Cc: Antonio Quartulli <antonio@open-mesh.com> Cc: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Cong Wang <cwang@twopensource.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fbdc0ad commit b6ed549

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/batman-adv/hard-interface.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static bool batadv_is_on_batman_iface(const struct net_device *net_dev)
8383
return true;
8484

8585
/* no more parents..stop recursion */
86-
if (net_dev->iflink == net_dev->ifindex)
86+
if (net_dev->iflink == 0 || net_dev->iflink == net_dev->ifindex)
8787
return false;
8888

8989
/* recurse over the parent device */

0 commit comments

Comments
 (0)