summaryrefslogtreecommitdiff
path: root/cesar/cp/sta/action
diff options
context:
space:
mode:
authorJérémy Dufour2010-09-14 16:11:32 +0200
committerJérémy Dufour2010-09-22 16:08:25 +0200
commit5fcef864110498447dd8c55fa3e84c16ee8ad832 (patch)
treea51601829284144222aa1e6e95436fd6b6b0ed83 /cesar/cp/sta/action
parent88fadc92757a22f931ff10ae4dce80742173e287 (diff)
cesar/cp/sta/action/sc: correctly compare MAC addresses, closes #1887
Diffstat (limited to 'cesar/cp/sta/action')
-rw-r--r--cesar/cp/sta/action/src/sc.c3
-rw-r--r--cesar/cp/sta/action/test/utest/src/sc.c9
2 files changed, 7 insertions, 5 deletions
diff --git a/cesar/cp/sta/action/src/sc.c b/cesar/cp/sta/action/src/sc.c
index 920b1e42e5..d27304c26f 100644
--- a/cesar/cp/sta/action/src/sc.c
+++ b/cesar/cp/sta/action/src/sc.c
@@ -343,7 +343,8 @@ cp_sta_action_sc__sc_join__cm_sc_join_req (cp_t *ctx, cp_mme_rx_t *mme)
const uint my_cco_cap = CP_CCO_LEVEL;
if ((my_cco_cap > cco_cap)
|| ((my_cco_cap == cco_cap)
- && (cp_sta_own_data_get_mac_address (ctx) > mme->peer.mac)))
+ && (MAC_REVERSE (cp_sta_own_data_get_mac_address (ctx))
+ > MAC_REVERSE (mme->peer.mac))))
{
/* My CCo capabilities are greater than the peer. */
/* Act if we were in SC_ADD procedure. */
diff --git a/cesar/cp/sta/action/test/utest/src/sc.c b/cesar/cp/sta/action/test/utest/src/sc.c
index 472594d238..7304531bf8 100644
--- a/cesar/cp/sta/action/test/utest/src/sc.c
+++ b/cesar/cp/sta/action/test/utest/src/sc.c
@@ -30,10 +30,10 @@ sc_basic_test_cases (test_t t)
.cp = &ctx.cp,
};
/* Configure my MAC address. */
- const mac_t my_mac = 0x111111111111ull;
+ const mac_t my_mac = MAC_ADDRESS (0x00, 0x13, 0xd7, 0x00, 0x00, 0x01);
cp_sta_own_data_set_mac_address (&ctx.cp, my_mac);
- const mac_t sc_add_mac = 0x222222222222ull;
- const mac_t sc_join_mac = 0x333333333333ull;
+ const mac_t sc_add_mac = MAC_ADDRESS (0x00, 0x13, 0xd7, 0x00, 0x00, 0x02);
+ const mac_t sc_join_mac = MAC_ADDRESS (0x00, 0x13, 0xd7, 0x00, 0x00, 0x03);
const cp_nid_t nid = 0xF11111111111ull;
cp_mme_peer_t all_sta = CP_MME_PEER (MAC_BROADCAST,
MAC_TEI_UNASSOCIATED);
@@ -504,7 +504,8 @@ sc_basic_test_cases (test_t t)
cp_sta_t *sc_join_sta = cp_sta_mgr_sta_add (&ctx.cp, net, 0,
sc_join_mac);
/* Setup our MAC to something higher than the peer. */
- cp_sta_own_data_set_mac_address (&ctx.cp, sc_join_mac + 1);
+ cp_sta_own_data_set_mac_address
+ (&ctx.cp, MAC_ADDRESS (0x00, 0x13, 0xd7, 0x00, 0x42, 0x01));
/* STA replies to SC.JOIN.REQ with SC.JOIN.REQ. */
scenario_entry_t sc_join_reply[] = {
/* Run start of SC join procedure. */