summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorNélio Laranjeiro2010-11-17 14:10:30 +0100
committerNélio Laranjeiro2010-11-18 17:08:21 +0100
commit0ccab3f4d51d35306d8aed01dfc0dc4b839cc29d (patch)
tree76a1debecdd43e688c825ae67cde0b832c9772c1 /cesar
parent559c2eb382fe640fdf1e58ae85fae8380b5f77da (diff)
cesar/cp/cco-action: remove station on a new ASSOC.REQ join, closes #2077
Diffstat (limited to 'cesar')
-rw-r--r--cesar/cp/cco/action/src/cco_action.c2
-rw-r--r--cesar/cp/cco/action/test/src/action-test.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/cesar/cp/cco/action/src/cco_action.c b/cesar/cp/cco/action/src/cco_action.c
index a8b29f00dc..9efc1dd578 100644
--- a/cesar/cp/cco/action/src/cco_action.c
+++ b/cesar/cp/cco/action/src/cco_action.c
@@ -412,6 +412,8 @@ cp_cco_action__assoc__join (cp_t *ctx, cp_mme_rx_t *msg,
// The station already exists get the TEI.
tei = cp_sta_get_tei (sta);
}
+ /* Remove the station from the station manager and the mac store. */
+ cp_sta_mgr_sta_remove (ctx, sta);
slab_release (sta);
}
/* If the station has no TEI, try to generate one. */
diff --git a/cesar/cp/cco/action/test/src/action-test.c b/cesar/cp/cco/action/test/src/action-test.c
index 31060cc5c7..c4fb56c3c3 100644
--- a/cesar/cp/cco/action/test/src/action-test.c
+++ b/cesar/cp/cco/action/test/src/action-test.c
@@ -659,6 +659,11 @@ test_case_sta_assoc_procedure (test_t test)
cp.cco_action.tei_flags[6] = 0xFFFFFFFF;
cp.cco_action.tei_flags[7] = 0xFFFFFFFF;
+ sta = cp_sta_mgr_sta_get_from_mac (&cp, 2);
+ cp_sta_set_authenticated (&cp, sta, true);
+ test_fail_unless (cp_sta_get_authenticated (&cp, sta));
+ test_fail_unless (sta);
+ slab_release (sta);
// Construct the MME to associate the first station.
mme_rx.peer.mac = 2;
mme_rx.peer.vlan_tag = 0;
@@ -686,7 +691,7 @@ test_case_sta_assoc_procedure (test_t test)
net = cp_sta_mgr_get_our_avln (&cp);
sta = cp_sta_mgr_sta_get_from_mac (&cp, 2);
-
+ test_fail_unless (cp_sta_get_authenticated (&cp, sta) == false);
test_fail_if (sta == NULL);
slab_release (sta);
}