summaryrefslogtreecommitdiff
path: root/bgpd/bgpd.c
diff options
context:
space:
mode:
authorPaul Jakma <paul@quagga.net>2012-06-13 22:50:07 +0100
committerPaul Jakma <paul@quagga.net>2012-06-13 22:50:07 +0100
commitad12dde6f9596997337ebc210dd2d4593438556b (patch)
tree661e013c488b2f7003b8b817d680fa9d03f4eb30 /bgpd/bgpd.c
parent22714f99c4ffeb4d1bade7ad6374adeba0e06e4c (diff)
Revert "bgpd: Make socket init separate, so unit tests work again."
This reverts commit 7621f336e2f346edee43227f0b1ef93fe769720b. See bug #727
Diffstat (limited to 'bgpd/bgpd.c')
-rw-r--r--bgpd/bgpd.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 31ce5a16..bdc4e289 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -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)
}
-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)
{