]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Setup of incoming connection is now a separate function.
authorMartin Mares <mj@ucw.cz>
Sun, 7 May 2000 10:41:45 +0000 (10:41 +0000)
committerMartin Mares <mj@ucw.cz>
Sun, 7 May 2000 10:41:45 +0000 (10:41 +0000)
TODO
proto/bgp/bgp.c

diff --git a/TODO b/TODO
index 6faae87e37eeb86757e5cc7fcb6b6bfaa70b5562..c8162b4de175854eeb7cac42101760dbf8cffe54 100644 (file)
--- a/TODO
+++ b/TODO
@@ -15,8 +15,6 @@ Core
 
 - filters: deletion of mandatory attributes?
 
-- bgp: wait on restart
-
 Documentation
 ~~~~~~~~~~~~~
 - write doctool
index 41081f265d92541f308cd5975124e94963a16973..ecaa9e36acdff09e5cbf8ea96b3bedc4d556ae1a 100644 (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_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);