Skip to content

Commit

Permalink
batman: fix a bogus warning from batadv_is_on_batman_iface()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cong Wang authored and David S. Miller committed May 22, 2014
1 parent fbdc0ad commit b6ed549
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit b6ed549

Please sign in to comment.