]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Revert "bgpd: Make socket init separate, so unit tests work again."
authorPaul Jakma <paul@quagga.net>
Wed, 13 Jun 2012 21:50:07 +0000 (22:50 +0100)
committerPaul Jakma <paul@quagga.net>
Wed, 13 Jun 2012 21:50:07 +0000 (22:50 +0100)
This reverts commit 7621f336e2f346edee43227f0b1ef93fe769720b. See bug #727

bgpd/bgp_main.c
bgpd/bgpd.c
bgpd/bgpd.h

index 5abc875652d824ea50bab96a006b755b4673e1ea..0f1d4829c17630aa3ce10e323455f5288aec33e1 100644 (file)
@@ -441,12 +441,6 @@ main (int argc, char **argv)
   if(dryrun)
     return(0);
   
-  if (bgp_socket_init ())
-    {
-      zlog_err ("BGP socket creation failed");
-      return 1;
-    }
-  
   /* Turn into daemon if daemon_mode is set. */
   if (daemon_mode && daemon (0, 0) < 0)
     {
index 31ce5a164f5a7b8e8430da5428bea38f2136e14a..bdc4e2896509d40da9b712fa7e7e2d614efc9f19 100644 (file)
@@ -2063,6 +2063,13 @@ bgp_get (struct bgp **bgp_val, as_t *as, const char *name)
   bgp_router_id_set(bgp, &router_id_zebra);
   *bgp_val = bgp;
 
+  /* Create BGP server socket, if first instance.  */
+  if (list_isempty(bm->bgp))
+    {
+      if (bgp_socket (bm->port, bm->address) < 0)
+       return BGP_ERR_INVALID_VALUE;
+    }
+
   listnode_add (bm->bgp, bgp);
 
   return 0;
@@ -5342,15 +5349,6 @@ bgp_master_init (void)
 }
 
 \f
-int
-bgp_socket_init (void)
-{
-  /* Create BGP server socket */
-  if (bgp_socket (bm->port, bm->address) < 0)
-    return BGP_ERR_INVALID_VALUE;
-  return 0;
-}
-
 void
 bgp_init (void)
 {
index 03a998b96389b17ddff80e8001a1c99d571ae8d1..bb3071600a0d35d9d5dbc5141b2baeba74966313 100644 (file)
@@ -846,7 +846,6 @@ extern void bgp_config_write_family_header (struct vty *, afi_t, safi_t, int *);
 extern void bgp_master_init (void);
 
 extern void bgp_init (void);
-extern int bgp_socket_init (void);
 extern void bgp_route_map_init (void);
 
 extern int bgp_option_set (int);