From 9165888ad24bdefed6a705219c767558d5091cec Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 27 Apr 2000 19:41:10 +0000 Subject: Handle connect errors correctly. --- proto/bgp/bgp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 0939f691..d694555d 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -160,16 +160,18 @@ bgp_sock_err(sock *sk, int err) { case BS_CONNECT: case BS_OPENSENT: + sk_close(conn->sk); + conn->sk = NULL; conn->state = BS_ACTIVE; bgp_start_timer(conn->connect_retry_timer, conn->bgp->cf->connect_retry_time); break; case BS_OPENCONFIRM: case BS_ESTABLISHED: + bgp_close_conn(conn); break; default: bug("bgp_sock_err called in invalid state %d", conn->state); } - bgp_close_conn(conn); } static void -- cgit v1.2.3