aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-09-26 16:15:07 +0000
committerChristian Grothoff <christian@grothoff.org>2016-09-26 16:15:07 +0000
commitcd62e6773d90353b859ae0127fe3e48045efce46 (patch)
treef05f931c1eb9d4ba17c457f94a94106fd2b6501f /src/util
parent736ff56bade57c6b2e5f6b593d2f79e10d6e6705 (diff)
downloadgnunet-cd62e6773d90353b859ae0127fe3e48045efce46.tar.gz
gnunet-cd62e6773d90353b859ae0127fe3e48045efce46.zip
refuse to run if binds fail
Diffstat (limited to 'src/util')
-rw-r--r--src/util/service_new.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/service_new.c b/src/util/service_new.c
index c15d98161..95bdca33b 100644
--- a/src/util/service_new.c
+++ b/src/util/service_new.c
@@ -1279,13 +1279,25 @@ setup_service (struct GNUNET_SERVICE_Handle *sh)
1279 { 1279 {
1280 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, 1280 GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR,
1281 "bind"); 1281 "bind");
1282 GNUNET_free (addrs[i++]);
1282 GNUNET_free (slc); 1283 GNUNET_free (slc);
1283 continue; 1284 continue;
1284 } 1285 }
1286 GNUNET_free (addrs[i++]);
1285 GNUNET_CONTAINER_DLL_insert (sh->slc_head, 1287 GNUNET_CONTAINER_DLL_insert (sh->slc_head,
1286 sh->slc_tail, 1288 sh->slc_tail,
1287 slc); 1289 slc);
1288 } 1290 }
1291 GNUNET_free_non_null (addrlens);
1292 GNUNET_free_non_null (addrs);
1293 if ( (0 != num) &&
1294 (NULL == sh->slc_head) )
1295 {
1296 /* All attempts to bind failed, hard failure */
1297 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1298 _("Could not bind to any of the ports I was supposed to, refusing to run!\n"));
1299 return GNUNET_SYSERR;
1300 }
1289 } 1301 }
1290 1302
1291 sh->require_found = tolerant ? GNUNET_NO : GNUNET_YES; 1303 sh->require_found = tolerant ? GNUNET_NO : GNUNET_YES;