From c1135015135f9c664dd6735f30fc94772c0d9ce8 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 24 Feb 2018 01:50:46 +0100 Subject: RSL: Send ERROR REPORT on too short/truncated messages + wrong discriminator Change-Id: I6a0e63999f39592474064e2f05df450aec8e37fe --- src/common/rsl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/common/rsl.c') diff --git a/src/common/rsl.c b/src/common/rsl.c index 2638ad2f..bffe69d0 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -2276,6 +2276,7 @@ static int rsl_rx_rll(struct gsm_bts_trx *trx, struct msgb *msg) if (msgb_l2len(msg) < sizeof(*rh)) { LOGP(DRSL, LOGL_NOTICE, "RSL Radio Link Layer message too short\n"); + rsl_tx_error_report(trx, RSL_ERR_PROTO); msgb_free(msg); return -EIO; } @@ -2469,6 +2470,7 @@ static int rsl_rx_cchan(struct gsm_bts_trx *trx, struct msgb *msg) if (msgb_l2len(msg) < sizeof(*cch)) { LOGP(DRSL, LOGL_NOTICE, "RSL Common Channel Management message too short\n"); + rsl_tx_error_report(trx, RSL_ERR_PROTO); msgb_free(msg); return -EIO; } @@ -2598,6 +2600,7 @@ static int rsl_rx_trx(struct gsm_bts_trx *trx, struct msgb *msg) if (msgb_l2len(msg) < sizeof(*th)) { LOGP(DRSL, LOGL_NOTICE, "RSL TRX message too short\n"); + rsl_tx_error_report(trx, RSL_ERR_PROTO); msgb_free(msg); return -EIO; } @@ -2626,6 +2629,7 @@ static int rsl_rx_ipaccess(struct gsm_bts_trx *trx, struct msgb *msg) if (msgb_l2len(msg) < sizeof(*dch)) { LOGP(DRSL, LOGL_NOTICE, "RSL ip.access message too short\n"); + rsl_tx_error_report(trx, RSL_ERR_PROTO); msgb_free(msg); return -EIO; } @@ -2683,6 +2687,7 @@ int down_rsl(struct gsm_bts_trx *trx, struct msgb *msg) if (msgb_l2len(msg) < sizeof(*rslh)) { LOGP(DRSL, LOGL_NOTICE, "RSL message too short\n"); + rsl_tx_error_report(trx, RSL_ERR_PROTO); msgb_free(msg); return -EIO; } @@ -2708,6 +2713,7 @@ int down_rsl(struct gsm_bts_trx *trx, struct msgb *msg) default: LOGP(DRSL, LOGL_NOTICE, "unknown RSL msg_discr 0x%02x\n", rslh->msg_discr); + rsl_tx_error_report(trx, RSL_ERR_MSG_DISCR); msgb_free(msg); ret = -EINVAL; } -- cgit v1.2.3