diff options
author | laforge <laflocal@goeller.de.gnumonks.org> | 2010-06-21 12:08:52 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-06-21 12:09:41 +0200 |
commit | cfa4a01c8fe2b5f2ab1bfa6fcf23c35ff5e957f4 (patch) | |
tree | 232b06242cf4415cdaecfb62792db4ebb803e967 /openbsc/src/abis_rsl.c | |
parent | a69d923fd77e9b937cadfb5692e20576a01fede1 (diff) |
[RSL] hopping: Set correct L2 pseudo-length during IMMediate ASSign
Thanks to Sylvain for the hint that lead to this fix.
Diffstat (limited to 'openbsc/src/abis_rsl.c')
-rw-r--r-- | openbsc/src/abis_rsl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openbsc/src/abis_rsl.c b/openbsc/src/abis_rsl.c index 5017b5c09..266cb17cf 100644 --- a/openbsc/src/abis_rsl.c +++ b/openbsc/src/abis_rsl.c @@ -1132,6 +1132,8 @@ static void t3111_expired(void *data) rsl_rf_chan_release(lchan, 0); } +#define GSM48_LEN2PLEN(a) (((a) << 2) | 1) + /* MS has requested a channel on the RACH */ static int rsl_rx_chan_rqd(struct msgb *msg) { @@ -1196,7 +1198,7 @@ static int rsl_rx_chan_rqd(struct msgb *msg) /* create IMMEDIATE ASSIGN 04.08 messge */ memset(ia, 0, sizeof(*ia)); - ia->l2_plen = 0x2d; + /* we set ia->l2_plen once we know the length of the MA below */ ia->proto_discr = GSM48_PDISC_RR; ia->msg_type = GSM48_MT_RR_IMM_ASS; ia->page_mode = GSM48_PM_SAME; @@ -1211,6 +1213,7 @@ static int rsl_rx_chan_rqd(struct msgb *msg) ia->mob_alloc_len = lchan->ts->hopping.ma_len; memcpy(ia->mob_alloc, lchan->ts->hopping.ma_data, ia->mob_alloc_len); } + ia->l2_plen = GSM48_LEN2PLEN(sizeof(*ia) + ia->mob_alloc_len); DEBUGP(DRSL, "%s Activating ARFCN(%u) SS(%u) lctype %s " "r=%s ra=0x%02x\n", gsm_lchan_name(lchan), arfcn, subch, |