On Sun, May 07, 2023 at 07:11:50PM +0200, Claudio Jeker wrote:
> Please give the following diff a try and report back if it fixes your
> issue. When copying the output filters the refcnt for your
> match out to XYZ set nexthop BLA rule is not properly increased and when a
> peer flaps the counts are off and probably trigger both the crash and
> especially the fatal message.

This makes sense and looks good to me. I'm not sure how much testing you
want to see, but it might be better to land this.

ok tb

> 
> -- 
> :wq Claudio
> 
> Index: rde_filter.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/rde_filter.c,v
> retrieving revision 1.135
> diff -u -p -r1.135 rde_filter.c
> --- rde_filter.c      19 Apr 2023 13:23:33 -0000      1.135
> +++ rde_filter.c      7 May 2023 16:48:44 -0000
> @@ -583,6 +583,12 @@ filterset_copy(struct filter_set_head *s
>               if ((t = malloc(sizeof(struct filter_set))) == NULL)
>                       fatal(NULL);
>               memcpy(t, s, sizeof(struct filter_set));
> +             if (t->type == ACTION_RTLABEL_ID)
> +                     rtlabel_ref(t->action.id);
> +             else if (t->type == ACTION_PFTABLE_ID)
> +                     pftable_ref(t->action.id);
> +             else if (t->type == ACTION_SET_NEXTHOP_REF)
> +                     nexthop_ref(t->action.nh_ref);
>               TAILQ_INSERT_TAIL(dest, t, entry);
>       }
>  }
> 

Reply via email to