diff options
author | Harald Welte <laforge@gnumonks.org> | 2013-07-06 23:36:57 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2013-07-06 23:36:57 +0200 |
commit | 1342bed6f961ad6dafb5db7cfb0459278506b08a (patch) | |
tree | 18d61c9b1bd0e6586446444a4e5e4aa89d1270ab /src/gsm/lapd_core.c | |
parent | 8d50600d7d927a5c9f08c2a9573b6a45866dc602 (diff) | |
parent | 2b0cac4ef83137ee0bdd583aee877eac467abeab (diff) |
Merge branch 'jolly/trx'
Diffstat (limited to 'src/gsm/lapd_core.c')
-rw-r--r-- | src/gsm/lapd_core.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 116e3116..68b5e784 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -826,14 +826,23 @@ static int lapd_rx_u(struct msgb *msg, struct lapd_msg_ctx *lctx) * 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); + /* 5.4.2.1 */ + if (!length) { + /* If no content resolution, this is a + * re-establishment. */ + LOGP(DLLAPD, LOGL_INFO, + "Remote reestablish\n"); break; } + if (!dl->cont_res) { + LOGP(DLLAPD, LOGL_INFO, "SABM command not " + "allowed in this state\n"); + mdl_error(MDL_CAUSE_SABM_MF, lctx); + msgb_free(msg); + return 0; + } /* Ignore SABM if content differs from first SABM. */ - if (dl->mode == LAPD_MODE_NETWORK && length - && dl->cont_res) { + if (dl->mode == LAPD_MODE_NETWORK && length) { #ifdef TEST_CONTENT_RESOLUTION_NETWORK dl->cont_res->data[0] ^= 0x01; #endif |