ipa_client: check if stream is alive
Otherwise we might send over a non-existant stream.
This commit is contained in:
parent
afcdf9b932
commit
63327450c9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue