summaryrefslogtreecommitdiff
path: root/cesar/cp
diff options
context:
space:
mode:
authorNĂ©lio Laranjeiro2011-05-31 09:48:11 +0200
committerJean-Philippe SAVE2011-06-22 11:17:12 +0200
commite91870cedb6106040ad4c9183cee56a975d01bc8 (patch)
tree1de32aa924be70362b08167acf2076aeb8775a40 /cesar/cp
parent205a2620db54fa59752fe77c67395a66afb1bd45 (diff)
Revert "cesar/cp/cl_interf: authorize MME with MMEType 0, closes #2438"
This reverts commit 54e523e0a8948a0cdfddafcce04a88fda2a07f4e. Conflicts: cesar/cp/msg/src/msg.c
Diffstat (limited to 'cesar/cp')
-rw-r--r--cesar/cp/cl_interf/test/src/test-cl-interf.c3
-rw-r--r--cesar/cp/msg/src/msg.c5
-rw-r--r--cesar/cp/msg/test/src/test-msg-read-header.c5
3 files changed, 5 insertions, 8 deletions
diff --git a/cesar/cp/cl_interf/test/src/test-cl-interf.c b/cesar/cp/cl_interf/test/src/test-cl-interf.c
index 667967e479..3218c32f2f 100644
--- a/cesar/cp/cl_interf/test/src/test-cl-interf.c
+++ b/cesar/cp/cl_interf/test/src/test-cl-interf.c
@@ -505,8 +505,7 @@ cp_msg_mme_read_header (cp_t *ctx, u8 *mme, uint length, cp_tei_t tei,
bitstream_access (&mme_rx->bitstream, fmi, 16);
// Verify some data.
- if ((mmv > HPAV_MMV_MAX)
- || (swap16(mtype) != HPAV_MTYPE_MME))
+ if ((mmv != HPAV_MMV1) || (swap16(mtype) != HPAV_MTYPE_MME))
{
slab_release (mme_rx);
mme_rx = NULL;
diff --git a/cesar/cp/msg/src/msg.c b/cesar/cp/msg/src/msg.c
index c9001b4bee..045e905510 100644
--- a/cesar/cp/msg/src/msg.c
+++ b/cesar/cp/msg/src/msg.c
@@ -1048,8 +1048,7 @@ cp_msg_mme_read_header_initialised (cp_mme_rx_t *mme, uint *fmi,
bitstream_access (&mme->bitstream, fmi, 16);
// Verify some data.
- if ((mme->mmv > HPAV_MMV_MAX)
- || (swap16(mtype) != HPAV_MTYPE_MME))
+ if ((mme->mmv != HPAV_MMV1) || (swap16(mtype) != HPAV_MTYPE_MME))
{
return false;
}
@@ -1275,7 +1274,7 @@ cp_msg_mme_read_header_enc (cp_t *ctx, cp_mme_rx_t *mme)
bitstream_access (&mme->bitstream, &mme->mmtype, 16);
// FMI
bitstream_access (&mme->bitstream, &data, 16);
- if ((mmv > HPAV_MMV_MAX)
+ if ((mmv != HPAV_MMV1)
|| (mtype != swap16(HPAV_MTYPE_MME))
|| (oda != cp_sta_own_data_get_mac_address (ctx))
|| (osa != mme->peer.mac)
diff --git a/cesar/cp/msg/test/src/test-msg-read-header.c b/cesar/cp/msg/test/src/test-msg-read-header.c
index c3d26c163d..d16b5caa2c 100644
--- a/cesar/cp/msg/test/src/test-msg-read-header.c
+++ b/cesar/cp/msg/test/src/test-msg-read-header.c
@@ -197,7 +197,7 @@ test_case_msg_read_header_mme_without_vlan (test_t test)
test_end;
slab_release (mme);
- test_case_begin (test, "TEST 3 - MMV == 0");
+ test_case_begin (test, "TEST 3");
bitstream_init (&bitstream, buffer, 23, BITSTREAM_WRITE);
data = 0x123456789ABCull;
@@ -218,8 +218,7 @@ test_case_msg_read_header_mme_without_vlan (test_t test)
test_begin (test, "Read a MME without vlan")
{
- test_fail_unless (mme);
- slab_release (mme);
+ test_fail_if (mme != NULL, "Shall be null");
}
test_end;