summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authormercadie2010-05-21 15:42:36 +0000
committermercadie2010-05-21 15:42:36 +0000
commit2f8d15cd65dc8745e245486010ea3753610742b6 (patch)
tree562c707f6344435f05f9fe59301596e1c07a01dd /cesar
parent6de0800be1e295c6072c282a6b0801960467bc24 (diff)
cesar/cp/beacon: replace a dangerous assert with a safe return
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7126 017c9cb6-072f-447c-8318-d5b54f68fe89
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;