diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2023-11-21 14:26:43 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2023-12-11 10:06:16 +0100 |
commit | 647b8d09782a57504e2ab760456f81623601f312 (patch) | |
tree | 2fe92592d828f7069c252813368651b9add4cc88 | |
parent | bc6cc67115821fd86ec4c6cd06d8b1e0ce356a85 (diff) |
LAPDm: Reject (release) establishment on DCCH, SAPI 0 without L3 payload
If the channel is activated for immediate assignment, the initial data
link establishment on main signaling link with SAPI 0 must have L3
infomation included in the SABM message. If this is not the case,
release the data link without notifying BSC.
Related: OS#5971
Change-Id: I6819b51a876b8743c2d4a04165b7900723a1631c
-rw-r--r-- | include/osmo-bts/lchan.h | 2 | ||||
-rw-r--r-- | src/common/rsl.c | 20 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h index 05c395a3..92973a7f 100644 --- a/include/osmo-bts/lchan.h +++ b/include/osmo-bts/lchan.h @@ -208,6 +208,8 @@ struct gsm_lchan { uint8_t sapis_dl[23]; uint8_t sapis_ul[23]; struct lapdm_channel lapdm_ch; + /* It is required to have L3 info with DL establishment. */ + bool l3_info_estab; struct llist_head dl_tch_queue; unsigned int dl_tch_queue_len; struct { diff --git a/src/common/rsl.c b/src/common/rsl.c index deeb255c..b5ec17f7 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1907,6 +1907,9 @@ static int rsl_rx_chan_activ(struct msgb *msg) reactivation = true; } + /* If Activation Type is IMMEDIATE ASSIGNMENT, we expect L3 info with establishment. */ + lchan->l3_info_estab = (type == RSL_ACT_INTRA_IMM_ASS); + if (!reactivation && lchan->state != LCHAN_S_NONE) { LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "error: lchan is not available, but in state: %s.\n", gsm_lchans_name(lchan->state)); @@ -3831,6 +3834,23 @@ int lapdm_rll_tx_cb(struct msgb *msg, struct lapdm_entity *le, void *ctx) msg->trx = lchan->ts->trx; msg->lchan = lchan; + /* If DL estabishment on main signaling link and SAPI 0 with L3 info is expected. */ + if (lchan->l3_info_estab && rh->msg_type == RSL_MT_EST_IND) { + struct abis_rsl_rll_hdr *rllh = msgb_l2(msg); + if ((rllh->link_id & 0xc7) == 0) { + /* Reject initial establishment without L3 info. */ + if (msgb_l2len(msg) == sizeof(struct abis_rsl_rll_hdr)) { + LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "RLL EST IND without contention resolution.\n"); + /* Release normally, re-use the msgb. */ + rh->msg_type = RSL_MT_REL_REQ; + msgb_tv_put(msg, RSL_IE_RELEASE_MODE, RSL_REL_NORMAL); + return rsl_rx_rll(lchan->ts->trx, msg); + } + /* Re-estabishment without contention resoltuion is allowed. */ + lchan->l3_info_estab = false; + } + } + /* If this is a Measurement Report, then we simply ignore it, * because it has already been processed in l1sap_ph_data_ind(). */ if (rslms_is_meas_rep(msg)) { |