summaryrefslogtreecommitdiffstats
path: root/proto/bgp
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-07 12:41:45 +0200
committerMartin Mares <mj@ucw.cz>2000-05-07 12:41:45 +0200
commitacfce55c8637988954543c60597cd2f1525ba6ec (patch)
treed01456d486ef38e0fff9f1d8f4115efa415fe2bd /proto/bgp
parentce1da96ee7efc9310f138e4234495557cdef59e2 (diff)
downloadbird-acfce55c8637988954543c60597cd2f1525ba6ec.tar
bird-acfce55c8637988954543c60597cd2f1525ba6ec.zip
Setup of incoming connection is now a separate function.
Diffstat (limited to 'proto/bgp')
-rw-r--r--proto/bgp/bgp.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 41081f2..ecaa9e3 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -27,6 +27,7 @@ static char *bgp_state_names[] = { "Idle", "Connect", "Active", "OpenSent", "Ope
static void bgp_connect(struct bgp_proto *p);
static void bgp_initiate(struct bgp_proto *p);
+static void bgp_setup_listen_sk(void);
void
bgp_close(struct bgp_proto *p)
@@ -309,12 +310,8 @@ bgp_incoming_connection(sock *sk, int dummy)
}
static void
-bgp_start_neighbor(struct bgp_proto *p)
+bgp_setup_listen_sk(void)
{
- p->local_addr = p->neigh->iface->addr->ip;
- DBG("BGP: local=%I remote=%I\n", p->local_addr, p->next_hop);
- if (!bgp_counter++)
- init_list(&bgp_list);
if (!bgp_listen_sk)
{
sock *s = sk_new(&root_pool);
@@ -334,6 +331,16 @@ bgp_start_neighbor(struct bgp_proto *p)
else
bgp_listen_sk = s;
}
+}
+
+static void
+bgp_start_neighbor(struct bgp_proto *p)
+{
+ p->local_addr = p->neigh->iface->addr->ip;
+ DBG("BGP: local=%I remote=%I\n", p->local_addr, p->next_hop);
+ if (!bgp_counter++)
+ init_list(&bgp_list);
+ bgp_setup_listen_sk();
if (!bgp_linpool)
bgp_linpool = lp_new(&root_pool, 4080);
add_tail(&bgp_list, &p->bgp_node);