bts-virt: Don't rely on gsmtap_makemsg() returning NULL for GSMTAP_CHANNEL_UNKNOWN

commit d211c490ca avoided sending
GSMTAP packets on the virtual Um interface with type
GSMTAP_CHANNEL_UNKNOWN by relying on gsmtap_makemsg returning NULL.
But that's not the corect approach since it's totally fine to be sending
GSMTAP_CHANNEL_UNKNOWN on some GSMTAP cases (for instance when the
program fails to infer the type when decoding a message), since then
this way one can study pcap files and find the offending encoded
messages which failed to be decoded.

This patch goes togehter with revert patch introduced in libosmocore as
explained in the commit referred above.

Change-Id: I233afd930d3e43f7b120d40192c7c192102e38d9
This commit is contained in:
Pau Espin 2020-07-06 14:41:47 +02:00 committed by pespin
parent 3daccb151f
commit 9b2641ff3d
1 changed files with 4 additions and 1 deletions

View File

@ -78,9 +78,12 @@ static void _tx_to_virt_um(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
else
gsmtap_chantype = chantype_rsl2gsmtap2(rsl_chantype, chdesc->link_id, is_voice_frame); /* the logical channel type */
if (gsmtap_chantype == GSMTAP_CHANNEL_UNKNOWN)
if (gsmtap_chantype == GSMTAP_CHANNEL_UNKNOWN) {
LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Tx GSMTAP for RSL channel type 0x%02x: cannot send, this"
" channel type is unknown in GSMTAP\n", rsl_chantype);
msgb_free(msg);
return;
}
#if MODULO_HYPERFRAME
/* Restart fn after every superframe (26 * 51 frames) to simulate hyperframe overflow each 6 seconds. */