From 3859e4efc1597368df647323c5a3cc1771cb64ca Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 9 Dec 2022 05:51:30 +0100 Subject: BGP: Improve handling of hold and keepalive timers The effective keepalive time now scales relative to the negotiated hold time, to maintain proportion between the keepalive time and the hold time. This avoids issues when both keepalive and hold times were configured, the hold time was negotiated to a smaller value, but the keepalive time stayed the same. Add new options 'min hold time' and 'min keepalive time', which reject session attempts with too small hold time. Improve validation of config options an their documentation. Thanks to Alexander Zubkov and Sergei Goriunov for suggestions. --- proto/bgp/bgp.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'proto/bgp/bgp.h') diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h index eda5d229..ec802fde 100644 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@ -120,8 +120,11 @@ struct bgp_config { unsigned llgr_time; /* Long-lived graceful restart stale time */ unsigned connect_delay_time; /* Minimum delay between connect attempts */ unsigned connect_retry_time; /* Timeout for connect attempts */ - unsigned hold_time, initial_hold_time; + unsigned hold_time; + unsigned min_hold_time; /* Minimum accepted hold time */ + unsigned initial_hold_time; unsigned keepalive_time; + unsigned min_keepalive_time; /* Minimum accepted keepalive time */ unsigned error_amnesia_time; /* Errors are forgotten after */ unsigned error_delay_time_min; /* Time to wait after an error is detected */ unsigned error_delay_time_max; -- cgit v1.2.3