diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-07-06 14:41:47 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2020-07-09 11:44:12 +0000 |
commit | 9b2641ff3d060ad55e27f557842ea16a89f8970d (patch) | |
tree | 9a98cb8da6b39be0c4d14100ec0adec14cfdb70d | |
parent | 3daccb151f910c9ed5ff30d48fd68fd93a2e891f (diff) |
bts-virt: Don't rely on gsmtap_makemsg() returning NULL for GSMTAP_CHANNEL_UNKNOWN
commit d211c490cad38f2009943121d57bdb7df8eee9b0 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
-rw-r--r-- | src/osmo-bts-virtual/scheduler_virtbts.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/osmo-bts-virtual/scheduler_virtbts.c b/src/osmo-bts-virtual/scheduler_virtbts.c index 1c2b057e..466e864f 100644 --- a/src/osmo-bts-virtual/scheduler_virtbts.c +++ b/src/osmo-bts-virtual/scheduler_virtbts.c @@ -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. */ |