Przeglądaj źródła

gluon-radv-filterd: Fix use-after-free when best router expires

Jan-Philipp Litza 7 lat temu
rodzic
commit
bc3c8b3cc6

+ 2 - 0
package/gluon-radv-filterd/src/gluon-radv-filterd.c

@@ -312,6 +312,8 @@ static void expire_routers() {
 		if (router->eol < now) {
 			DEBUG_MSG("router " F_MAC " expired", F_MAC_VAR(router->src));
 			*prev_ptr = router->next;
+			if (G.best_router == router)
+				G.best_router = NULL;
 			free(router);
 		} else {
 			prev_ptr = &router->next;