this looks reasonable and fixes my problem
OK florian

On Mon, Mar 08, 2021 at 01:01:34PM +0100, Claudio Jeker wrote:
> The last commit introduced an error in prefix_eligible(). For nexthops the
> logic is not quite right since a NULL nexthop is actually fine. These
> nexhops are created for local announcements (unless their nexthop is
> overridden).
> 
> -- 
> :wq Claudio
> 
> Index: rde_decide.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/rde_decide.c,v
> retrieving revision 1.82
> diff -u -p -r1.82 rde_decide.c
> --- rde_decide.c      2 Mar 2021 09:45:07 -0000       1.82
> +++ rde_decide.c      8 Mar 2021 11:56:30 -0000
> @@ -423,8 +423,11 @@ prefix_eligible(struct prefix *p)
>       /* The aspath needs to be loop and error free */
>       if (asp == NULL || asp->flags & (F_ATTR_LOOP|F_ATTR_PARSE_ERR))
>               return 0;
> -     /* The nexthop needs to exist and be reachable */
> -     if (nh == NULL || nh->state != NEXTHOP_REACH)
> +     /*
> +      * If the nexthop exists it must be reachable.
> +      * It is OK if the nexthop does not exist (local announcement).
> +      */
> +     if (nh != NULL && nh->state != NEXTHOP_REACH)
>               return 0;
>  
>       return 1;
> 


-- 
I'm not entirely sure you are real.

Reply via email to