[quagga-dev 3657] Re: 0.98.4 bug report: files ospf_opaque.c, ospf_vty.c and ospf6_asbr.c

Paul Jakma paul at clubi.ie
Sat Sep 17 19:56:42 BST 2005

On Sat, 17 Sep 2005, Andrew J. Schorr wrote:

> OK.  I guess this should be cleaned up at some point, but my goals 
> are more modest at the moment: simply to eliminate the 
> brain-damaged code that says "struct ospf *ospf = ospf;".


> One example is in lookup_opaque_info_by_type where it says:
>      top = ospf_lookup ();
>      if ((area = lsa->area) != NULL && (top = area->ospf) == NULL)
>        {
>          zlog_warn ("Type-11 Opaque-LSA: Reference to OSPF is missing?");

Ah, fun.

To be honest, ospf_lookup() is brain-damaged too. There's only two 
ways to determine ospf context externally:

1. Associating a packet to an ospf_interface
2. Explicit user direction (ie by commands 'router ospf <instance>')

Nearly everything else would derive from one of those two, directly 
or indirectly (eg a new LSA -> ospf_interface -> ospf -> install to 
lsdb. The LSA forever has a reference to the correct ospf.)

But of course then there's point 3:

3. We don't even support multiple instances
4. If we did, tacking on struct ospf args to lots of functions is the
    /worst/ way to do it for it would be error-prone (particularly if
    ospf_lookup() is used, which has only a 1/(# instances) change of
    being the correct instance ;) )

All this stuff is incomplete and useless baggage from GNU Zebra yonks 

> OK, I'll bang it in.


Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
Safety Third.

More information about the Quagga-dev mailing list