On Mon, Aug 28, 2023 at 05:02:40PM +0530, Bala Sajja wrote: > Hi, > It seems where BGP connect retry timer to be kicked in use cases > also, connect delay timer gets kicked in. In the below function, > though bgp_setup_conn(p, conn) sets connect_timer to connect retry > timer, later it's over written by bgp_start_timer(conn->connect_timer, > delay) which sets connect_timer to connect delay timer. Is this right > ? Could we make the connect retry timer work properly ?
Hi I am not sure what do you mean. The timer connect_timer is used for two purposes, for connect_delay_time before we try to connnect (in the state BS_ACTIVE), and for connect_retry_time while we try to connect (in the state BS_CONNECT). The first is initialized in bgp_active(), the second in bgp_connect(). The call bgp_setup_conn(p, conn) just allocates the timer, but it does not sets it to any interval. > > bgp_active(struct bgp_proto *p) > { > int delay = MAX(1, p->cf->connect_delay_time); > struct bgp_conn *conn = &p->outgoing_conn; > > BGP_TRACE(D_EVENTS, "Connect delayed by %d seconds", delay); > bgp_setup_conn(p, conn); > bgp_conn_set_state(conn, BS_ACTIVE); > bgp_start_timer(conn->connect_timer, delay); > } -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santi...@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."