[quagga-dev 7924] Re: ospfd: connected routes not redistributed

Roman Hoog Antink rha at open.ch
Tue Apr 13 12:07:22 BST 2010


Joakim Tjernlund wrote:
> I suspect something like this would do the trick:
> 
> Index: ospf_zebra.c
> ===================================================================
> --- ospf_zebra.c	(revision 60861)
> +++ ospf_zebra.c	(working copy)
> @@ -942,14 +942,9 @@
>    struct external_info *ei;
>    struct route_table *rt;
>    struct ospf_lsa *lsa;
> -  intptr_t type;
> +  int type;
>    struct ospf *ospf;
> 
> -  type = (intptr_t)THREAD_ARG (thread);
> -  assert (type <= ZEBRA_ROUTE_MAX);
> -
> -  rt = EXTERNAL_INFO (type);
> -
>    ospf = ospf_lookup ();
>    if (ospf == NULL)
>      return 0;
> @@ -959,17 +954,22 @@
>    zlog_info ("Zebra[Redistribute]: distribute-list update timer fired!");
> 
>    /* foreach all external info. */
> -  if (rt)
> -    for (rn = route_top (rt); rn; rn = route_next (rn))
> -      if ((ei = rn->info) != NULL)
> -        {
> -          if (is_prefix_default (&ei->p))
> -            ospf_external_lsa_refresh_default (ospf);
> -          else if ((lsa = ospf_external_info_find_lsa (ospf, &ei->p)))
> -            ospf_external_lsa_refresh (ospf, lsa, ei, LSA_REFRESH_IF_CHANGED);
> -          else
> -            ospf_external_lsa_originate (ospf, ei);
> -        }
> +  for (type = 0; type <= ZEBRA_ROUTE_MAX; type++)
> +    {
> +      rt = EXTERNAL_INFO (type);
> +      if (!rt)
> +	continue;
> +      for (rn = route_top (rt); rn; rn = route_next (rn))
> +	if ((ei = rn->info) != NULL)
> +	  {
> +	    if (is_prefix_default (&ei->p))
> +	      ospf_external_lsa_refresh_default (ospf);
> +	    else if ((lsa = ospf_external_info_find_lsa (ospf, &ei->p)))
> +	      ospf_external_lsa_refresh (ospf, lsa, ei, LSA_REFRESH_IF_CHANGED);
> +	    else
> +	      ospf_external_lsa_originate (ospf, ei);
> +	  }
> +    }
>    return 0;
>  }
> 


I tested your patch successfully (based on quagga.git). It is indeed the best solution we discussed so far.



More information about the Quagga-dev mailing list