Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: bgpd: clear rtr last errors on end of data event
To:
tech@openbsd.org
Date:
Thu, 11 Jan 2024 16:32:01 +0100

Download raw body.

Thread
On Thu, Jan 11, 2024 at 03:24:39PM +0100, Claudio Jeker wrote:
> Currently the last_recv_error and last_sent_error (plus msgs) are too
> sticky. They remain way after the error happened since they were never
> cleared. This diff clears this values when a RTR_EVNT_END_OF_DATA event
> is generated. This means the cache was successfully loaded and so the
> old reported errors no longer matter.
> 
> I think this is a good compromise between showing very old errors and
> losing this information too soon.

ok tb

> -- 
> :wq Claudio
> 
> Index: rtr_proto.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/rtr_proto.c,v
> diff -u -p -r1.30 rtr_proto.c
> --- rtr_proto.c	11 Jan 2024 13:08:39 -0000	1.30
> +++ rtr_proto.c	11 Jan 2024 14:15:33 -0000
> @@ -1174,6 +1174,11 @@ rtr_fsm(struct rtr_session *rs, enum rtr
>  		rtr_sem_release(rs->active_lock);
>  		rtr_recalc();
>  		rs->active_lock = 0;
> +		/* clear the last errors */
> +		rs->last_sent_error = NO_ERROR;
> +		rs->last_recv_error = NO_ERROR;
> +		rs->last_sent_msg[0] = '\0';
> +		rs->last_recv_msg[0] = '\0';
>  		break;
>  	case RTR_EVNT_CACHE_RESET:
>  		rtr_reset_cache(rs);
>