Setup of incoming connection is now a separate function.

This commit is contained in:
Martin Mares 2000-05-07 10:41:45 +00:00
parent ce1da96ee7
commit acfce55c86
2 changed files with 12 additions and 7 deletions

2
TODO
View file

@ -15,8 +15,6 @@ Core
- filters: deletion of mandatory attributes? - filters: deletion of mandatory attributes?
- bgp: wait on restart
Documentation Documentation
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
- write doctool - write doctool

View file

@ -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_connect(struct bgp_proto *p);
static void bgp_initiate(struct bgp_proto *p); static void bgp_initiate(struct bgp_proto *p);
static void bgp_setup_listen_sk(void);
void void
bgp_close(struct bgp_proto *p) bgp_close(struct bgp_proto *p)
@ -309,12 +310,8 @@ bgp_incoming_connection(sock *sk, int dummy)
} }
static void 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) if (!bgp_listen_sk)
{ {
sock *s = sk_new(&root_pool); sock *s = sk_new(&root_pool);
@ -334,6 +331,16 @@ bgp_start_neighbor(struct bgp_proto *p)
else else
bgp_listen_sk = s; 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) if (!bgp_linpool)
bgp_linpool = lp_new(&root_pool, 4080); bgp_linpool = lp_new(&root_pool, 4080);
add_tail(&bgp_list, &p->bgp_node); add_tail(&bgp_list, &p->bgp_node);