summaryrefslogtreecommitdiffstats
path: root/tests/lapd
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2014-03-20 19:24:48 +0100
committerDaniel Willmann <daniel@totalueberwachung.de>2014-03-26 18:11:07 +0100
commit3dc4e16786d1e5723e76ad7c70ad54134957f9e5 (patch)
treec8a9609da0fff4967574b1d7af375d58a65f4788 /tests/lapd
parent09129352f99a90a784912ae3c8ff442268a35480 (diff)
gsm/lapdm: Prevent LAPD tx_queue from filling up in polling mode
If LAPDm receives an I-Frame while there already is an I-Frame in the tx_queue the code generates an additional RR (to acknowledge the received I-Frame). Instead, N(R) of the I-Frame in the tx_queue should be updated to ACK the data.
Diffstat (limited to 'tests/lapd')
-rw-r--r--tests/lapd/lapd_test.c12
-rw-r--r--tests/lapd/lapd_test.ok14
2 files changed, 9 insertions, 17 deletions
diff --git a/tests/lapd/lapd_test.c b/tests/lapd/lapd_test.c
index c8bb394d..18ea1dc3 100644
--- a/tests/lapd/lapd_test.c
+++ b/tests/lapd/lapd_test.c
@@ -621,17 +621,13 @@ const uint8_t gprs_susp[] = {
0xd2, 0x6f, 0x09, 0xf1, 0x07, 0x00, 0x01, 0x00, 0x02
};
-const uint8_t gprs_susp_ack[] = {
- 0x01, 0x41, 0x01
-};
-
const uint8_t cipher_cmd[] = {
0x06, 0x35, 0x01
};
-/* The cipher command we send to the MS */
+/* The cipher command we send to the MS after updating our N(R) */
const uint8_t cipher_cmd_out[] = {
- 0x03, 0x20, 0x0d, 0x06, 0x35, 0x01
+ 0x03, 0x40, 0x0d, 0x06, 0x35, 0x01
};
uint8_t cipher_compl[] = {
@@ -730,7 +726,7 @@ static void test_lapdm_desync()
rc = dequeue_prim(&bts_to_ms_channel.lapdm_dcch, &pp, "DCCH");
CHECK_RC(rc);
- OSMO_ASSERT(memcmp(pp.oph.msg->l2h, gprs_susp_ack, ARRAY_SIZE(gprs_susp_ack)) == 0);
+ OSMO_ASSERT(memcmp(pp.oph.msg->l2h, cipher_compl_ack, ARRAY_SIZE(cipher_compl_ack)) == 0);
printf("\nEstablishing SAPI=3\n");
send_sabm(&bts_to_ms_channel, 3, NULL, 0);
@@ -746,7 +742,7 @@ static void test_lapdm_desync()
rc = dequeue_prim(&bts_to_ms_channel.lapdm_dcch, &pp, "DCCH");
CHECK_RC(rc);
- OSMO_ASSERT(memcmp(pp.oph.msg->l2h, cipher_compl_ack, ARRAY_SIZE(cipher_compl_ack)) == 0);
+ OSMO_ASSERT(memcmp(pp.oph.msg->l2h, cp_data_1_ack, ARRAY_SIZE(cp_data_1_ack)) == 0);
/* clean up */
lapdm_channel_exit(&bts_to_ms_channel);
diff --git a/tests/lapd/lapd_test.ok b/tests/lapd/lapd_test.ok
index a58a118c..e188e27e 100644
--- a/tests/lapd/lapd_test.ok
+++ b/tests/lapd/lapd_test.ok
@@ -68,27 +68,24 @@ Sending GPRS Suspend Request
bts_to_ms_dummy_tx_cb: MS->BTS(us) message 22
Dumping queue:
-00 00 17 [L2]> 03 20 0d [L3]> 06 35 01
-00 00 17 [L2]> 01 41 01
+00 00 17 [L2]> 03 40 0d [L3]> 06 35 01
Took message from DCCH queue: L2 header size 3, L3 size 20, SAP 0x1000000, 0/0, Link 0x00
-Message: [L2]> 03 20 0d [L3]> 06 35 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
+Message: [L2]> 03 40 0d [L3]> 06 35 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
Sending Cipher Mode Complete
bts_to_ms_dummy_tx_cb: MS->BTS(us) message 11
Dumping queue:
-00 00 17 [L2]> 01 41 01
00 00 17 [L2]> 01 61 01
Took message from DCCH queue: L2 header size 23, L3 size 0, SAP 0x1000000, 0/0, Link 0x00
-Message: [L2]> 01 41 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
+Message: [L2]> 01 61 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
Establishing SAPI=3
bts_to_ms_dummy_tx_cb: MS->BTS(us) message 6
Dumping queue:
-00 00 17 [L2]> 01 61 01
Took message from DCCH queue: L2 header size 3, L3 size 20, SAP 0x1000000, 0/0, Link 0x03
Message: [L2]> 0d 73 01 [L3]> 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
@@ -96,8 +93,7 @@ Message: [L2]> 0d 73 01 [L3]> 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
Sending CP-DATA
Dumping queue:
-00 00 17 [L2]> 01 61 01
-Took message from DCCH queue: L2 header size 23, L3 size 0, SAP 0x1000000, 0/0, Link 0x00
-Message: [L2]> 01 61 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
+Took message from DCCH queue: L2 header size 23, L3 size 0, SAP 0x1000000, 0/0, Link 0x03
+Message: [L2]> 0d 21 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b
Success.