bgpd: revised fix to --dryrun (BZ#622)
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index dafbbf7..b9fdfd7 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -2044,6 +2044,10 @@
 	}
     }
 
+  bgp = bgp_create (as, name);
+  bgp_router_id_set(bgp, &router_id_zebra);
+  *bgp_val = bgp;
+
   /* Create BGP server socket, if first instance.  */
   if (list_isempty(bm->bgp))
     {
@@ -2051,10 +2055,7 @@
 	return BGP_ERR_INVALID_VALUE;
     }
 
-  bgp = bgp_create (as, name);
   listnode_add (bm->bgp, bgp);
-  bgp_router_id_set(bgp, &router_id_zebra);
-  *bgp_val = bgp;
 
   return 0;
 }