[Olsr-cvs] olsrd-current/src lq_route.c, 1.39, 1.40 lq_mpr.c, 1.9, 1.10 neighbor_table.c, 1.28, 1.29

Andreas T�nnesen (spam-protected)
Tue Nov 29 19:38:00 CET 2005


Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22188/src

Modified Files:
	lq_route.c lq_mpr.c neighbor_table.c 
Log Message:
Added checks for NULL returned from get_best_link_to_neighbor in the LQ code

Index: lq_route.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** lq_route.c	16 Nov 2005 23:55:54 -0000	1.39
--- lq_route.c	29 Nov 2005 18:37:58 -0000	1.40
***************
*** 427,430 ****
--- 427,433 ----
          link = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
  
+ 	if(!link)
+ 	  continue;
+ 
          if (link->loss_link_quality2 >= MIN_LINK_QUALITY &&
              link->neigh_link_quality2 >= MIN_LINK_QUALITY)

Index: lq_mpr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_mpr.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** lq_mpr.c	16 Feb 2005 14:44:43 -0000	1.9
--- lq_mpr.c	29 Nov 2005 18:37:58 -0000	1.10
***************
*** 108,111 ****
--- 108,114 ----
                link = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
  
+ 	      if(!link)
+ 		continue;
+ 
                best = link->loss_link_quality * link->neigh_link_quality;
  

Index: neighbor_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/neighbor_table.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** neighbor_table.c	29 May 2005 12:47:45 -0000	1.28
--- neighbor_table.c	29 Nov 2005 18:37:58 -0000	1.29
***************
*** 501,506 ****
  	  struct link_entry *link =
              get_best_link_to_neighbor(&neigh->neighbor_main_addr);
! 	  double best_lq = link->neigh_link_quality;
! 	  double inv_best_lq = link->loss_link_quality;
  
            OLSR_PRINTF(1, fstr, olsr_ip_to_string(&neigh->neighbor_main_addr),
--- 501,511 ----
  	  struct link_entry *link =
              get_best_link_to_neighbor(&neigh->neighbor_main_addr);
! 	  double best_lq, inv_best_lq;
! 
! 	  if(!link) 
! 	    continue;
! 
! 	  best_lq = link->neigh_link_quality;
! 	  inv_best_lq = link->loss_link_quality;
  
            OLSR_PRINTF(1, fstr, olsr_ip_to_string(&neigh->neighbor_main_addr),





More information about the Olsr-cvs mailing list