diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2008-10-29 14:16:34 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2008-10-29 14:16:34 +0100 |
commit | e16466b379be2b94c84b351a69e63b6de5be9dc5 (patch) | |
tree | d1b33be94f4181aaaeec89597e8f09093c8bceda | |
parent | f0ad56f4414fef2781339cfa41704f7bf4c61ad2 (diff) |
Fix race condition that breaks BGP connections after reconfigure.
RFC says that only connections in OpenConfirm and Established state
should participate in connection collision detection.
The current implementation leads to race condition when both sides
are trying to connect at the almost same time, then both sides
receive OPEN message by different connections at the almost same
time and close the other connection. Both connections are
closed and the both sides end in start/idle or start/active
state.
-rw-r--r-- | proto/bgp/packets.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index c18c6e42..84e6ffd5 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -510,12 +510,9 @@ bgp_rx_open(struct bgp_conn *conn, byte *pkt, int len) switch (other->state) { case BS_IDLE: - break; case BS_CONNECT: case BS_ACTIVE: case BS_OPENSENT: - BGP_TRACE(D_EVENTS, "Connection collision, giving up the other connection"); - bgp_close_conn(other); break; case BS_OPENCONFIRM: if ((p->local_id < id) == (conn == &p->incoming_conn)) |