summaryrefslogtreecommitdiff
path: root/cesar/cp/beacon/src/beacon.c
diff options
context:
space:
mode:
authorYacine Belkadi2013-04-03 13:14:13 +0200
committerYacine Belkadi2013-05-23 09:07:26 +0200
commitfe3068ed91a25903b167e951cdd128ad52ec47c8 (patch)
tree5dc809ddd07edba108b54cf7dd4179d07e2b8a3f /cesar/cp/beacon/src/beacon.c
parente4b7731e1827efcc1af0a721cb5415039ae6f459 (diff)
cp/beacon/av: only request a NEK once
If for some reason the Sta doesn't have the new NEK when a NEK change countdown starts, it asks for it using the CM_GET_KEY MME. But it was asking for it in each beacon period of the countdown where it didn't have the new NEK. It doesn't seem useful to insist that much. If the new NEK is missing on a NEK change, only ask for it once.
Diffstat (limited to 'cesar/cp/beacon/src/beacon.c')
-rw-r--r--cesar/cp/beacon/src/beacon.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/cesar/cp/beacon/src/beacon.c b/cesar/cp/beacon/src/beacon.c
index 086253b8e1..1ecf0b015d 100644
--- a/cesar/cp/beacon/src/beacon.c
+++ b/cesar/cp/beacon/src/beacon.c
@@ -576,8 +576,17 @@ cp_beacon_process_bmi_eks (cp_t *ctx, const bsu_beacon_t *beacon)
|| (ctx->mac_config->nek_mgr.next_nek->eks
!= beacon->bmis.eks.new_eks))
{
- /* We don't have the new NEK. We need to ask for it. */
- cp_fsm_post_new_event (ctx, bare, nek_request);
+ /* We don't have the new NEK. We need to ask for it.
+ * But we don't want to ask many times. After all, this already
+ * is a fall-back mechanism in case we missed the CM_SET_KEY_REQ
+ * MME sent by the CCo before the start of a NEK change. It
+ * doesn't seem useful to insist that much. So, only ask once.
+ *
+ * If ctx->beacon.eks.kccd != 0, it means we are already aware
+ * of the countdown. So we already asked for the new missing
+ * NEK. */
+ if (ctx->beacon.eks.kccd == 0)
+ cp_fsm_post_new_event (ctx, bare, nek_request);
}
}