Commit 70f74777 authored by Robert Schmidt's avatar Robert Schmidt

Correctly implement proto_agent_stop(), call it

parent 920a4abb
...@@ -73,6 +73,10 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat ...@@ -73,6 +73,10 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
.remote_ipv4_address = RC.rrc[instance]->eth_params_s.remote_addr, .remote_ipv4_address = RC.rrc[instance]->eth_params_s.remote_addr,
.remote_port = RC.rrc[instance]->eth_params_s.remote_portd .remote_port = RC.rrc[instance]->eth_params_s.remote_portd
}; };
/* stop, then start the PROTO_AGENT. If it is already stopped, stopping it
* again will do nothing, therefore it is safe to call here.
* TODO: call proto_agent_stop() when CU_TASK is informed about conn release */
proto_agent_stop(instance);
AssertFatal(proto_agent_start(instance, &params) == 0, AssertFatal(proto_agent_start(instance, &params) == 0,
"could not start PROTO_AGENT for F1U on instance %d!\n", instance); "could not start PROTO_AGENT for F1U on instance %d!\n", instance);
} }
......
...@@ -137,7 +137,11 @@ error: ...@@ -137,7 +137,11 @@ error:
void proto_agent_stop(mod_id_t mod_id) void proto_agent_stop(mod_id_t mod_id)
{ {
if (!proto_agent[mod_id].channel) return;
proto_agent_async_release(proto_agent[mod_id].channel);
proto_agent_destroy_channel(proto_agent[mod_id].channel->channel_id); proto_agent_destroy_channel(proto_agent[mod_id].channel->channel_id);
free(proto_agent[mod_id].channel);
proto_agent[mod_id].channel = NULL;
} }
//void //void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment