]> Git Repo - linux.git/commitdiff
batman: fix a bogus warning from batadv_is_on_batman_iface()
authorCong Wang <[email protected]>
Thu, 22 May 2014 18:57:17 +0000 (11:57 -0700)
committerDavid S. Miller <[email protected]>
Thu, 22 May 2014 21:23:00 +0000 (17:23 -0400)
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 <[email protected]>
Tested-by: Jet Chen <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Steffen Klassert <[email protected]>
Cc: Antonio Quartulli <[email protected]>
Cc: Marek Lindner <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/batman-adv/hard-interface.c

index b851cc58085330acbab02848fedf3cb01751a060..fbda6b54baffccf798375cb8add49bb179738386 100644 (file)
@@ -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 */
This page took 0.057686 seconds and 4 git commands to generate.