summaryrefslogtreecommitdiff
path: root/cesar/bsu/beacon/src
diff options
context:
space:
mode:
authorlaranjeiro2010-07-22 08:40:30 +0000
committerlaranjeiro2010-07-22 08:40:30 +0000
commit9937873816f818f936b95e6e54a403aa7c88c426 (patch)
treee573483145f5de95bd3489237bed4464028046f0 /cesar/bsu/beacon/src
parentdadc2453b5d46bd6bcc277a372857fd95fddedf5 (diff)
cesar/bsu: reset schedules before reading it from beacon
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7301 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/bsu/beacon/src')
-rw-r--r--cesar/bsu/beacon/src/beacon.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/cesar/bsu/beacon/src/beacon.c b/cesar/bsu/beacon/src/beacon.c
index 5a9d5bb16a..e2cc63c533 100644
--- a/cesar/bsu/beacon/src/beacon.c
+++ b/cesar/bsu/beacon/src/beacon.c
@@ -18,6 +18,19 @@
#include "cp/defs.h"
/**
+ * Reset the schedules data.
+ * \param schedule the schedule to reset.
+ * Reset only persistent schedules, non persistent schedules, bpsto value.
+ */
+static inline void
+bsu_beacon_schedules_reset (bsu_beacon_schedules_t *schedule)
+{
+ schedule->ps.nb = 0;
+ schedule->nps.ns = 0;
+ schedule->bpsto.present = false;
+}
+
+/**
* Get the NID from the beacon.
* \param beacon the beacon to extract the NID.
* \return the NID.
@@ -1023,6 +1036,8 @@ bsu_beacon_read_schedules (pb_beacon_t *beacon,
bitstream_skip (&stream, 40);
/* Read number of beacon entry. */
nbe = bitstream_read (&stream, 8);
+ /* Reset schedule data. */
+ bsu_beacon_schedules_reset (schedules);
for (i = 0; i < nbe; i++)
{
if (bsu_beacon_read_bmi_header (&stream, &header, &length))