[commits] [alfred] master: alfred: vis: Fix ifindex check when registering interface (0e0fcc5)

postmaster at open-mesh.org postmaster at open-mesh.org
Sat Aug 3 19:00:09 CEST 2019


Repository : ssh://git@open-mesh.org/alfred

On branch  : master

>---------------------------------------------------------------

commit 0e0fcc5bca8159ad5e96f8d8165afbbae5ec95a5
Author: Sven Eckelmann <sven at narfation.org>
Date:   Fri Aug 2 08:35:53 2019 +0200

    alfred: vis: Fix ifindex check when registering interface
    
    The return value of if_nametoindex should be checked before the rtnl query
    is send to the kernel. Otherwise we might try to operate on an ifindex
    which doesn't exist in the kernel - which will never register any interface.
    
    Fixes: a34f044de561 ("alfred: vis: Use rtnl to query list of hardifs of meshif")
    Signed-off-by: Sven Eckelmann <sven at narfation.org>


>---------------------------------------------------------------

0e0fcc5bca8159ad5e96f8d8165afbbae5ec95a5
 vis/vis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vis/vis.c b/vis/vis.c
index 8df3056..cdc5524 100644
--- a/vis/vis.c
+++ b/vis/vis.c
@@ -617,7 +617,7 @@ static int register_interfaces(struct globals *globals)
 	};
 
 	register_arg.ifindex = if_nametoindex(globals->interface);
-	if (!globals->interface)
+	if (!register_arg.ifindex)
 		return EXIT_FAILURE;
 
 



More information about the commits mailing list