diff options
-rw-r--r-- | src/ats/perf_ats_solver.c | 11 | ||||
-rw-r--r-- | src/ats/plugin_ats_mlp.c | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c index 7d29e4b64..025fab721 100644 --- a/src/ats/perf_ats_solver.c +++ b/src/ats/perf_ats_solver.c | |||
@@ -1428,7 +1428,13 @@ perf_run_iteration (void) | |||
1428 | { | 1428 | { |
1429 | cur_addr = perf_create_address (cp, ca); | 1429 | cur_addr = perf_create_address (cp, ca); |
1430 | /* Add address */ | 1430 | /* Add address */ |
1431 | ph.env.sf.s_add (ph.solver, cur_addr, GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_ATS_NetworkTypeCount)); | 1431 | uint32_t net = 1 + GNUNET_CRYPTO_random_u32(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_ATS_NetworkTypeCount - 1); |
1432 | cur_addr->atsi = GNUNET_new (struct GNUNET_ATS_Information); | ||
1433 | cur_addr->atsi_count = 1; | ||
1434 | cur_addr->atsi[0].type = htonl (GNUNET_ATS_NETWORK_TYPE); | ||
1435 | cur_addr->atsi[0].value = htonl (net); | ||
1436 | ph.env.sf.s_add (ph.solver, cur_addr, net); | ||
1437 | |||
1432 | ph.current_a = ca + 1; | 1438 | ph.current_a = ca + 1; |
1433 | perf_address_initial_update (ph.solver, ph.addresses, cur_addr); | 1439 | perf_address_initial_update (ph.solver, ph.addresses, cur_addr); |
1434 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1440 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
@@ -1496,7 +1502,8 @@ perf_run_iteration (void) | |||
1496 | ph.env.sf.s_del (ph.solver, cur, GNUNET_NO); | 1502 | ph.env.sf.s_del (ph.solver, cur, GNUNET_NO); |
1497 | next = cur->next; | 1503 | next = cur->next; |
1498 | GNUNET_CONTAINER_DLL_remove(ph.peers[cp].head, ph.peers[cp].tail, cur); | 1504 | GNUNET_CONTAINER_DLL_remove(ph.peers[cp].head, ph.peers[cp].tail, cur); |
1499 | GNUNET_free(cur); | 1505 | GNUNET_free_non_null (cur->atsi); |
1506 | GNUNET_free (cur); | ||
1500 | } | 1507 | } |
1501 | } | 1508 | } |
1502 | 1509 | ||
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c index 1c93915cf..1cbfbddfa 100644 --- a/src/ats/plugin_ats_mlp.c +++ b/src/ats/plugin_ats_mlp.c | |||
@@ -366,7 +366,7 @@ mlp_solve_to_string (int retcode) | |||
366 | * @param type the type to extract in HBO | 366 | * @param type the type to extract in HBO |
367 | * @return the value in HBO or GNUNET_ATS_VALUE_UNDEFINED in HBO if value does not exist | 367 | * @return the value in HBO or GNUNET_ATS_VALUE_UNDEFINED in HBO if value does not exist |
368 | */ | 368 | */ |
369 | static int | 369 | static uint32_t |
370 | get_performance_info (struct ATS_Address *address, uint32_t type) | 370 | get_performance_info (struct ATS_Address *address, uint32_t type) |
371 | { | 371 | { |
372 | int c1; | 372 | int c1; |