ipa_client: check if stream is alive

Otherwise we might send over a non-existant stream.
This commit is contained in:
Alexander Couzens 2024-02-13 19:21:32 +01:00
parent afcdf9b932
commit 63327450c9
1 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,12 @@ METHOD(osmo_epdg_ipa_client_t, send_pdu, ssize_t,
head->len = htons(msgb_length(msg) - (sizeof(struct ipaccess_head)));
head->data[0] = osmo_proto;
len = msgb_length(msg);
if (!this->stream)
{
free(msg);
return -ENOENT;
}
if (!this->stream->write_all(this->stream, msgb_data(msg), msgb_length(msg)))
{
// TODO: write error