mirror of https://gerrit.osmocom.org/libosmocore
gsmtap: deal with apps that call gsmtap_send*() with NULL gsmtap_inst
This commit is contained in:
parent
b62b04bbf3
commit
13692a6bd3
|
@ -148,6 +148,9 @@ int gsmtap_source_add_sink_fd(int gsmtap_fd)
|
|||
|
||||
int gsmtap_sendmsg(struct gsmtap_inst *gti, struct msgb *msg)
|
||||
{
|
||||
if (!gti)
|
||||
return -ENODEV;
|
||||
|
||||
if (gti->ofd_wq_mode)
|
||||
return osmo_wqueue_enqueue(>i->wq, msg);
|
||||
else {
|
||||
|
@ -175,6 +178,9 @@ int gsmtap_send(struct gsmtap_inst *gti, uint16_t arfcn, uint8_t ts,
|
|||
{
|
||||
struct msgb *msg;
|
||||
|
||||
if (!gti)
|
||||
return -ENODEV;
|
||||
|
||||
msg = gsmtap_makemsg(arfcn, ts, chan_type, ss, fn, signal_dbm,
|
||||
snr, data, len);
|
||||
if (!msg)
|
||||
|
|
Loading…
Reference in New Issue