summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-06-20 07:49:08 +0000
committerMartin Mares <mj@ucw.cz>2000-06-20 07:49:08 +0000
commitbcbdcbb6ae7256e01165220bb3b2d5b72850f665 (patch)
tree24a8e31086f672e0d9a10e188297a6a60c03fdfe
parentf9eb8f7e066970d56a814128fd49170348a7fbd8 (diff)
Don't accept incoming connections when the neighbor is not up.
-rw-r--r--proto/bgp/bgp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 6bdb5fc0..72eba1af 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -383,7 +383,7 @@ bgp_incoming_connection(sock *sk, int dummy)
if (ipa_equal(p->cf->remote_ip, sk->daddr))
{
match = 1;
- if (p->p.proto_state == PS_START || p->p.proto_state == PS_UP)
+ if ((p->p.proto_state == PS_START || p->p.proto_state == PS_UP) && p->neigh && p->neigh->iface)
{
BGP_TRACE(D_EVENTS, "Incoming connection from %I port %d", sk->daddr, sk->dport);
if (p->incoming_conn.sk)
@@ -488,6 +488,7 @@ bgp_start(struct proto *P)
p->outgoing_conn.state = BS_IDLE;
p->incoming_conn.state = BS_IDLE;
p->startup_delay = 0;
+ p->neigh = NULL;
bgp_counter++;
bgp_setup_listen_sk();