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

Paul Jakma paul at clubi.ie
Fri Sep 16 19:39:12 BST 2005


On Thu, 15 Sep 2005, Andrew J. Schorr wrote:

> Are you referring to this code?
>
>   void
>   ospf_opaque_lsa_refresh_schedule (struct ospf_lsa *lsa0)
>   {
>     struct ospf *ospf = ospf;
>
> and
>
>   void
>   ospf_opaque_lsa_flush_schedule (struct ospf_lsa *lsa0)
>   {
>     struct ospf *ospf = ospf;
>
> I must admit that I cannot see any valid reason for doing
> that.  I also do not understand why gcc does not issue
> a warning.

It's damn silly, get rid 'struct ospf *' altogether there. You can 
find the correct struct ospf by navigating through struct ospf_lsa 
(lsa0->area->ospf).

It's an artifact of the never-completed "multiple struct ospf 
support" added yonks ago in GNU Zebra. Which was done mostly by 
adding 'struct ospf *' arguments to every damn function, even where 
other arguments to the same function already had a way to get to that 
same structure.

Nearly any function which take the following as arguments:

struct ospf_area 
struct ospf_lsa
struct ospf_interface

or anything which 'inherits' from the above, as ospf_lsa does from 
ospf_area, has no need at all to take 'struct ospf *' as an argument 
too.

I've not yet been bothered enough to undo this GNU Zebra 
brain-damage.

regards,
-- 
Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
Fortune:
Leela: Hold Still, I don't have good depth perception!



More information about the Quagga-dev mailing list