diff options
author | Harald Welte <laforge@osmocom.org> | 2022-04-25 09:44:25 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2022-05-03 14:04:22 +0200 |
commit | d8d2e19e8490131f09144352924294a56c068e22 (patch) | |
tree | b0f3f304ce9678af4d56eca461ff41c7f4760cc0 | |
parent | d88f8f8ebf0ab6daf1c8661726859910ee1f1663 (diff) |
smscb: Don't include extraneous IEs in CBSP KILL COMPLETE / FAILURE
TS 48.049 states the following rules for the KILL COMPLETE / FAILURE
messages:
The Number of Broadcasts Completed List IE, if present, contains for
each cell the total number of broadcasts of the killed CBS message.
The Cell List IE, if present, contains the cells in which the emergency
message is successfully terminated.
As any message can only be either emergency or CBS, this means that
we can (at maximum) have only one of those two IEs in the message.
As there is no explicit indication in the KILL whether it relates
to CBS or Emergency, we use the "Channel Indicator" IE, which is
specified as "only included if the message refers to a CBS message".
Related: SYS#5906
Closes: OS#5541
Change-Id: I9a43d386da01f085663d231a555b8b5acc99faca
(cherry picked from commit 5e7458cbd8d38b3a2d8f3444c79aa03e82104ade)
-rw-r--r-- | src/osmo-bsc/smscb.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/osmo-bsc/smscb.c b/src/osmo-bsc/smscb.c index 5fe63459b..c89bedb4b 100644 --- a/src/osmo-bsc/smscb.c +++ b/src/osmo-bsc/smscb.c @@ -791,11 +791,16 @@ static int cbsp_rx_kill(struct bsc_cbc_link *cbc, const struct osmo_cbsp_decoded fail->channel_ind = kill->channel_ind; llist_replace_head(&fail->fail_list, &r_state->fail); - fail->cell_list.id_discr = r_state->success.id_discr; - llist_replace_head(&fail->cell_list.list, &r_state->success.list); - - fail->num_compl_list.id_discr = r_state->num_completed.id_discr; - llist_replace_head(&fail->num_compl_list.list, &r_state->num_completed.list); + /* if the KILL relates to CBS, the "Channel Indicator" IE is present */ + if (kill->channel_ind) { + /* only if it was CBS */ + fail->num_compl_list.id_discr = r_state->num_completed.id_discr; + llist_replace_head(&fail->num_compl_list.list, &r_state->num_completed.list); + } else { + /* only if it was emergency */ + fail->cell_list.id_discr = r_state->success.id_discr; + llist_replace_head(&fail->cell_list.list, &r_state->success.list); + } } else { resp = osmo_cbsp_decoded_alloc(cbc, CBSP_MSGT_KILL_COMPL); struct osmo_cbsp_kill_complete *compl = &resp->u.kill_compl; @@ -803,11 +808,16 @@ static int cbsp_rx_kill(struct bsc_cbc_link *cbc, const struct osmo_cbsp_decoded compl->old_serial_nr = kill->old_serial_nr; compl->channel_ind = kill->channel_ind; - compl->cell_list.id_discr = r_state->success.id_discr; - llist_replace_head(&compl->cell_list.list, &r_state->success.list); - - compl->num_compl_list.id_discr = r_state->num_completed.id_discr; - llist_replace_head(&compl->num_compl_list.list, &r_state->num_completed.list); + /* if the KILL relates to CBS, the "Channel Indicator" IE is present */ + if (kill->channel_ind) { + /* only if it was CBS */ + compl->num_compl_list.id_discr = r_state->num_completed.id_discr; + llist_replace_head(&compl->num_compl_list.list, &r_state->num_completed.list); + } else { + /* only if it was emergency */ + compl->cell_list.id_discr = r_state->success.id_discr; + llist_replace_head(&compl->cell_list.list, &r_state->success.list); + } } cbsp_tx_decoded(cbc, resp); |