aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2009-12-21 13:27:11 +0100
committerHarald Welte <laforge@netfilter.org>2009-12-21 13:33:10 +0100
commitb8bfc567b7b8c705c1a2ec7654ce7184ab6c295f (patch)
treed68813dcea79112d7088b44df27ed9ac7b3b8298
parent38fe2a67e1a376e4370ddfed2f75687075cc9e6b (diff)
RSL: keep track if a channel is active or not
This allows us to block packets that we have received after the channel is no longer being used. This is visible during handover, where we still receive a measurement report after the MS has switched to the new channel. This leftover measurement report then attempts to trigger another handover, which si bogus and will fail - and thus only consumes resources. With the new LCHAN_S_ACTIVE state, we can check for this when processing the measurement report.
-rw-r--r--openbsc/include/openbsc/gsm_data.h9
-rw-r--r--openbsc/src/abis_rsl.c10
2 files changed, 19 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index f3ec9eb2..d19f38bc 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -151,6 +151,13 @@ struct gsm_loc_updating_operation {
#define LCHAN_SAPI_MS 1
#define LCHAN_SAPI_NET 2
+/* state of a logical channel */
+enum gsm_lchan_state {
+ LCHAN_S_NONE, /* channel is not active */
+ LCHAN_S_ACTIVE, /* channel is active and operational */
+ LCHAN_S_INACTIVE, /* channel is set inactive */
+};
+
struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;
@@ -162,6 +169,8 @@ struct gsm_lchan {
enum rsl_cmod_spd rsl_cmode;
/* If TCH, traffic channel mode */
enum gsm48_chan_mode tch_mode;
+ /* State */
+ enum gsm_lchan_state state;
/* Power levels for MS and BTS */
u_int8_t bs_power;
u_int8_t ms_power;
diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c
index a50d7aa1..72ae9dbb 100644
--- a/openbsc/src/abis_rsl.c
+++ b/openbsc/src/abis_rsl.c
@@ -918,6 +918,8 @@ static int rsl_rx_chan_act_ack(struct msgb *msg)
if (rslh->ie_chan != RSL_IE_CHAN_NR)
return -EINVAL;
+ msg->lchan->state = LCHAN_S_ACTIVE;
+
dispatch_signal(SS_LCHAN, S_LCHAN_ACTIVATE_ACK, msg->lchan);
return 0;
@@ -938,6 +940,8 @@ static int rsl_rx_chan_act_nack(struct msgb *msg)
print_rsl_cause(TLVP_VAL(&tp, RSL_IE_CAUSE),
TLVP_LEN(&tp, RSL_IE_CAUSE));
+ msg->lchan->state = LCHAN_S_NONE;
+
dispatch_signal(SS_LCHAN, S_LCHAN_ACTIVATE_NACK, msg->lchan);
lchan_free(msg->lchan);
@@ -1022,6 +1026,11 @@ static int rsl_rx_meas_res(struct msgb *msg)
const u_int8_t *val;
int rc;
+ /* check if this channel is actually active */
+ /* FIXME: maybe this check should be way more generic/centralized */
+ if (msg->lchan->state != LCHAN_S_ACTIVE)
+ return 0;
+
memset(mr, 0, sizeof(*mr));
mr->lchan = msg->lchan;
@@ -1128,6 +1137,7 @@ static int abis_rsl_rx_dchan(struct msgb *msg)
break;
case RSL_MT_RF_CHAN_REL_ACK:
DEBUGPC(DRSL, "RF CHANNEL RELEASE ACK\n");
+ msg->lchan->state = LCHAN_S_NONE;
lchan_free(msg->lchan);
break;
case RSL_MT_MODE_MODIFY_ACK: