-improve UDP logging
[oweals/gnunet.git] / src / testbed / testbed_api_topology.c
index 99ab76f8b29d584350237048db441e480755ea93..f23a771f9ebc2c58d8e9c12fe1fd7397f6993525 100644 (file)
@@ -1,6 +1,6 @@
 /*
       This file is part of GNUnet
-      (C) 2008--2013 Christian Grothoff (and other contributing authors)
+      Copyright (C) 2008--2013 Christian Grothoff (and other contributing authors)
 
       GNUnet is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License as published
@@ -725,6 +725,8 @@ gen_topo_random (struct TopologyContext *tc, unsigned int links, int append)
   uint32_t A_rand;
   uint32_t B_rand;
 
+  if (1 == tc->num_peers)
+    return;
   if (GNUNET_YES == append)
   {
     index = tc->link_array_size;
@@ -1468,6 +1470,7 @@ GNUNET_TESTBED_underlay_construct_ (int num_peers,
   GNUNET_assert (NULL != proc);
   ret = GNUNET_OK;
   memset (&tc, 0, sizeof (tc));
+  tc.num_peers = num_peers;
   tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY;
   underlay = &tc.u.underlay;
   va_start (vargs, cls);