[quagga-dev 1323] Re: ospfd dies -- bug in ospf_spf_consider_nexthop

Paul Jakma paul at clubi.ie
Thu Jul 1 09:29:26 BST 2004

On Sun, 20 Jun 2004, Andrew J. Schorr wrote:

> I think it's got to be the latter, because the patched LIST_LOOP 
> macro still has a curly brace problem,

Right, how's about:

#define LIST_LOOP(L,V,T,N) \
  for ((T) = (L)->head; (N) = (T)->next), (T != NULL); (T) = (N)) \
   if (((V) = (T)->data) != NULL)

> and it would require all invocations of LIST_LOOP to add a 4th 
> argument.  I count 174 uses of the LIST_LOOP macro in the current 
> code, so that seems like a daunting task.

I think they all have to be audited anyway, guaranteed the instance 
Kir found is not the only one. So either way, it's a chore but we can 
at least avail of the opportunity to prevent this buglet ever 
occuring again.

Alternatively, we can create above as LISTNODE_LOOP_DELETE_SAFE or 
somesuch and update those cases of LIST_LOOP which need it (as well 
as updating those cases which get it right by manual means to the 
macro) ;)

> The question that still remains is whether to fix the 
> LISTNODE_DELETE macro as I discussed in [quagga-dev 1295].  So far, 
> there are no uses of LISTNODE_DELETE except for Kir's patch.  If we 
> are going to keep that macro, I think it should be fixed, and it 
> should be used in the listnode_delete function (to reduce code 
> duplication).

Hmm, LISTNODE_DELETE is useful to shuffle a listnode from one list to 

I dont think it should be changed, I think all normal list users 
should use the function. Perhaps a comment by LISTNODE_DELETE would 
be enough to fix the not-a-problem, or rename it to LISTNODE_DETACH 
or somesuch to make it more obvious. (ditto for LISTNODE_ADD, 

> -Andy

Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
 	warning: do not ever send email to spam at dishone.st
I've run DOOM more in the last few days than I have the last few
months.  I just love debugging ;-)
(Linus Torvalds)

More information about the Quagga-dev mailing list