On Tue, Jul 26, 2022 at 07:04:36PM +0200, Claudio Jeker wrote:
> This is what I have in mind for that.

Yep, same here.

ok

> 
> -- 
> :wq Claudio
> 
> ? obj
> Index: kroute.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/kroute.c,v
> retrieving revision 1.281
> diff -u -p -r1.281 kroute.c
> --- kroute.c  26 Jul 2022 16:36:33 -0000      1.281
> +++ kroute.c  26 Jul 2022 16:37:17 -0000
> @@ -2060,11 +2060,7 @@ kif_remove(struct kif_node *kif)
>       if ((kt = ktable_get(kif->k.rdomain)) != NULL)
>               knexthop_track(kt, kif->k.ifindex);
>  
> -     if (RB_REMOVE(kif_tree, &kit, kif) == NULL) {
> -             log_warnx("RB_REMOVE(kif_tree, &kit, kif)");
> -             return (-1);
> -     }
> -
> +     RB_REMOVE(kif_tree, &kit, kif);
>       free(kif);
>       return (0);
>  }
> @@ -2549,7 +2545,8 @@ if_announce(void *msg)
>               break;
>       case IFAN_DEPARTURE:
>               kif = kif_find(ifan->ifan_index);
> -             kif_remove(kif);
> +             if (kif != NULL)
> +                     kif_remove(kif);
>               break;
>       }
>  }

Reply via email to