jolly submitted this change.
7 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
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
---
M include/osmo-bts/lchan.h
M src/common/rsl.c
2 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/include/osmo-bts/lchan.h b/include/osmo-bts/lchan.h
index 05c395a..92973a7 100644
--- a/include/osmo-bts/lchan.h
+++ b/include/osmo-bts/lchan.h
@@ -208,6 +208,8 @@
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 deeb255..b5ec17f 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1907,6 +1907,9 @@
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 @@
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)) {
To view, visit change 35082. To unsubscribe, or for help writing mail filters, visit settings.