aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-02-06 14:13:21 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-04-06 23:23:52 +0200
commit6e182087f4ef6cc73f245e0fbc5db11916651ba0 (patch)
tree03e38be814962e4d7a00040e3fbf1f273039befd /src
parentb64b2b031344b354b7a59f1eb4c1f97d457613f3 (diff)
Fix: LAPDm contention resoltion must acknowledge subsequent SABM
After reception of SABM, the network responds with UA and enters the establised multiframe state. If UA is not received by mobile, the SABM is transmitted again, and the network must respond with UA again, unless it is from a different mobile. Add LAPDm collision test (contention resolution on network side).
Diffstat (limited to 'src')
-rw-r--r--src/gsm/lapd_core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c
index b33cf6eb..f351308d 100644
--- a/src/gsm/lapd_core.c
+++ b/src/gsm/lapd_core.c
@@ -820,7 +820,12 @@ static int lapd_rx_u(struct msgb *msg, struct lapd_msg_ctx *lctx)
"frame established state\n");
/* If link is lost on the remote side, we start over
* and send DL-ESTABLISH indication again. */
- if (dl->v_send != dl->v_recv) {
+ /* Additionally, continue in case of content resoltion
+ * (GSM network). This happens, if the mobile has not
+ * yet received UA or another mobile (collision) tries
+ * to establish connection. The mobile must receive
+ * UA again. */
+ if (!dl->cont_res && dl->v_send != dl->v_recv) {
LOGP(DLLAPD, LOGL_INFO, "Remote reestablish\n");
mdl_error(MDL_CAUSE_SABM_MF, lctx);
break;
@@ -831,7 +836,8 @@ static int lapd_rx_u(struct msgb *msg, struct lapd_msg_ctx *lctx)
#ifdef TEST_CONTENT_RESOLUTION_NETWORK
dl->cont_res->data[0] ^= 0x01;
#endif
- if (memcmp(dl->cont_res, msg->data, length)) {
+ if (memcmp(dl->cont_res->data, msg->data,
+ length)) {
LOGP(DLLAPD, LOGL_INFO, "Another SABM "
"with diffrent content - "
"ignoring!\n");