Added checks for NULL returned from get_best_link_to_neighbor in the LQ code
[olsrd.git] / src / lq_mpr.c
index db3f567..d5c83f7 100644 (file)
@@ -36,7 +36,7 @@
  * to the project. For more information see the website or contact
  * the copyright holders.
  *
- * $Id: lq_mpr.c,v 1.9 2005/02/16 14:44:43 tlopatic Exp $
+ * $Id: lq_mpr.c,v 1.10 2005/11/29 18:37:58 kattemat Exp $
  */
 
 #include "defs.h"
@@ -107,6 +107,9 @@ void olsr_calculate_lq_mpr(void)
 
               link = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
 
+             if(!link)
+               continue;
+
               best = link->loss_link_quality * link->neigh_link_quality;
 
               // see wether we find a better route via an MPR