diff --git a/src/routing_layer/multicast.c b/src/routing_layer/multicast.c index 1318b5411..498719b3f 100644 --- a/src/routing_layer/multicast.c +++ b/src/routing_layer/multicast.c @@ -335,6 +335,10 @@ static int mc_report_send(struct multicast_ctx* ctx, struct mc_report* r) { d->on_loss(ctx->inst, &r->loss, d->arg); return 1; } + if (!etcp_router_conn_get(ctx->inst, r->loss.group_id, r->loss.source_node_id, ETCP_RT_ID_MULTICAST_REPORT)) { + DEBUG_ERROR(MC_CAT, "multicast report channel allocation failed source=%016llx", + (unsigned long long)r->loss.source_node_id); return -1; + } while (r->cursor < r->loss.recipient_count) { if (!etcp_router_send_q_has_room(ctx->inst, r->loss.group_id, r->loss.source_node_id, ETCP_RT_ID_MULTICAST_REPORT)) { etcp_router_on_send_ready(ctx->inst, r->loss.group_id, r->loss.source_node_id, diff --git a/tests/test_multicast.c b/tests/test_multicast.c index 718b16289..82d7e1183 100644 --- a/tests/test_multicast.c +++ b/tests/test_multicast.c @@ -206,7 +206,7 @@ static void teardown(struct fixture* f) { u_free(f->inst[i]); } CHECK(f->ua->timer_alloc_count == f->ua->timer_free_count); - uasync_destroy(f->ua); u_free(f); + uasync_destroy(f->ua, 0); u_free(f); } static void test_delivery(void) { @@ -296,6 +296,9 @@ static void test_overload(void) { CHECK(c.count == 0 && d.count == 32); CHECK(multicast_send(f->inst[A], fd, &one, 1, "one", 3) == 0); CHECK(l.count == 0); pump(f); + DEBUG_DEBUG(DEBUG_CATEGORY_GENERAL, "first report: losses=%u pending=%zu sent=%llu received=%llu overload=%llu", + l.count, stats(f, B).report_bytes, (unsigned long long)stats(f, B).reports_sent, + (unsigned long long)stats(f, A).reports_received, (unsigned long long)stats(f, B).overload_packets); CHECK(l.count == 1); CHECK(l.item[0].src == 2 && l.item[0].dst == 3 && l.item[0].source_node_id == 1 && l.item[0].descriptor == fd); CHECK(l.item[0].packets == 1 && l.item[0].recipient_count == 1 && l.ids[0][0] == 3); @@ -425,6 +428,11 @@ int main(void) { debug_config_init(); debug_set_level(DEBUG_LEVEL_WARN); debug_set_categories(DEBUG_CATEGORY_ALL); debug_set_category_level(DEBUG_CATEGORY_GENERAL, DEBUG_LEVEL_INFO); test_clock_init(1000); + if (getenv("UTUN_TEST_DEBUG")) { + debug_set_category_level(DEBUG_CATEGORY_GENERAL, DEBUG_LEVEL_DEBUG); + debug_set_category_level(DEBUG_CATEGORY_ETCPROUTE, DEBUG_LEVEL_TRACE); + debug_set_category_level(DEBUG_CATEGORY_TIMERS, DEBUG_LEVEL_DEBUG); + } test_delivery(); test_lifetime(); test_overload(); test_report_budget(); test_reroute(); test_validation(); test_descriptor_wrap(); test_clock_finish();