Handle connect errors correctly.
This commit is contained in:
parent
2add26dfa9
commit
9165888ad2
1 changed files with 3 additions and 1 deletions
|
@ -160,16 +160,18 @@ bgp_sock_err(sock *sk, int err)
|
||||||
{
|
{
|
||||||
case BS_CONNECT:
|
case BS_CONNECT:
|
||||||
case BS_OPENSENT:
|
case BS_OPENSENT:
|
||||||
|
sk_close(conn->sk);
|
||||||
|
conn->sk = NULL;
|
||||||
conn->state = BS_ACTIVE;
|
conn->state = BS_ACTIVE;
|
||||||
bgp_start_timer(conn->connect_retry_timer, conn->bgp->cf->connect_retry_time);
|
bgp_start_timer(conn->connect_retry_timer, conn->bgp->cf->connect_retry_time);
|
||||||
break;
|
break;
|
||||||
case BS_OPENCONFIRM:
|
case BS_OPENCONFIRM:
|
||||||
case BS_ESTABLISHED:
|
case BS_ESTABLISHED:
|
||||||
|
bgp_close_conn(conn);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bug("bgp_sock_err called in invalid state %d", conn->state);
|
bug("bgp_sock_err called in invalid state %d", conn->state);
|
||||||
}
|
}
|
||||||
bgp_close_conn(conn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue