summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
Diffstat (limited to 'cesar')
-rw-r--r--cesar/cp/beacon/src/beacon.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cesar/cp/beacon/src/beacon.c b/cesar/cp/beacon/src/beacon.c
index 688e443ae3..e9fe411071 100644
--- a/cesar/cp/beacon/src/beacon.c
+++ b/cesar/cp/beacon/src/beacon.c
@@ -481,7 +481,13 @@ cp_beacon_countdowns (cp_t *ctx)
intervals = (intervals + bp/2 - ctx->beacon.last_countdown_date) / bp;
- dbg_assert (intervals <= 7); // we missed too many periods.
+ /** We missed too many beacon period we shouldn't be associated
+ * anymore.
+ */
+ if (intervals > CP_MAX_NO_BEACON + 1)
+ {
+ return;
+ }
ctx->beacon.last_countdown_date = ctx->beacon.countdown_limit_date;