On Sat,  9 Apr 2016 17:22:32 +0300
Timo Teräs <[email protected]> wrote:

> The rib entries are normally added and deleted when they are
> changed. However, they are modified in placae when the nexthop
> reachability changes. This fixes to:
>  - properly detect nexthop changes from nexthop_active_update()
>    calls from rib_process()
>  - rib_update_kernel() to not reset FIB flags when a RIB entry
>    is being modifed (old and new RIB are same)
>  - improves the "show ip route <prefix>" output to display
>    both ACTIVE and FIB flags for each nexthop
> 
> Fixes: 325823a5 "zebra: support FIB override routes"
> Signed-off-by: Timo Teräs <[email protected]>
> ---
> Igor, can you verify if this fixes now the multihop problem for you?
> 
>  zebra/zebra_rib.c | 16 ++++++++++------
>  zebra/zebra_vty.c |  3 ++-
>  2 files changed, 12 insertions(+), 7 deletions(-)
> 
> diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
> index 1650dab..18eece8 100644
> --- a/zebra/zebra_rib.c
> +++ b/zebra/zebra_rib.c
> @@ -1124,12 +1123,15 @@ rib_update_kernel (struct route_node *rn,
> struct rib *old, struct rib *new) 
>    /* This condition is never met, if we are using rt_socket.c */
>    if (ret < 0 && new)
> +    {
>        for (ALL_NEXTHOPS_RO(new->nexthop, nexthop, tnexthop,
> recursing)) UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
> -
> -  if (old)
> -    for (ALL_NEXTHOPS_RO(old->nexthop, nexthop, tnexthop, recursing))
> -      UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
> +    }
> +  else if (old && old != new)
> +    {
> +      for (ALL_NEXTHOPS_RO(old->nexthop, nexthop, tnexthop,
> recursing))
> +        UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB);
> +    }
>  
>    return ret;
>  }

The code in this hunk is actually cumbersome. But I kept it like that
from the original code. What happens is that the main code is
responsible for updating flags on route deletion, and when things fail.
But the kernel update code does it when installing routes successfully.
It's slightly awkward to have same thing happen in different places
depending on the situation.

I think it would make sense to have the kernel side code update the
flags always. It would also allow things to be set right if the kernel
does not support atomic modification of routes.

Thoughts on this?

Thanks,
Timo

_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to