summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-04-27 21:41:10 +0200
committerMartin Mares <mj@ucw.cz>2000-04-27 21:41:10 +0200
commit9165888ad24bdefed6a705219c767558d5091cec (patch)
tree4dea1312a268073e2fa51fdd40665d42311699cb
parent2add26dfa9c1da1e7fd6248de593c60cf0eba9ca (diff)
downloadbird-9165888ad24bdefed6a705219c767558d5091cec.tar
bird-9165888ad24bdefed6a705219c767558d5091cec.zip
Handle connect errors correctly.
-rw-r--r--proto/bgp/bgp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 0939f69..d694555 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