Skip to content

Commit fcc33d5

Browse files
author
Mika Leppänen
committed
Removed time increment from NVM time read function on interface up
Enabled also time increase on supplicant by moving timer function call to PAE controller.
1 parent 9c8e3af commit fcc33d5

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

source/6LoWPAN/ws/ws_pae_controller.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,8 @@ void ws_pae_controller_slow_timer(uint16_t seconds)
16541654
}
16551655
ws_pae_controller_frame_counter_timer(seconds, entry);
16561656
}
1657+
1658+
ws_pae_current_time_update(seconds);
16571659
}
16581660

16591661
static void ws_pae_controller_frame_counter_timer(uint16_t seconds, pae_controller_t *entry)

source/6LoWPAN/ws/ws_pae_key_storage.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,6 @@ void ws_pae_key_storage_timer(uint16_t seconds)
888888
key_storage_params.store_timer = key_storage_params.store_timer_timeout;
889889
ws_pae_key_storage_store();
890890
}
891-
892-
ws_pae_current_time_update(seconds);
893891
}
894892

895893
void ws_pae_key_storage_fast_timer(uint16_t ticks)

source/6LoWPAN/ws/ws_pae_time.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
// Wednesday, January 1, 2020 0:00:00 GMT
3434
#define CURRENT_TIME_INIT_VALUE 1577836800
3535

36-
// Increment two hours in addition to maximum storing interval
37-
#define CURRENT_TIME_INCREMENT_VALUE (2 * 3600)
38-
3936
static uint64_t current_time = CURRENT_TIME_INIT_VALUE;
4037
static ns_time_api_system_time_callback *system_time_callback = NULL;
4138

@@ -167,15 +164,15 @@ int8_t ws_pae_current_time_set(uint64_t time)
167164
{
168165
current_time = time;
169166

167+
tr_debug("Current time set: %"PRIi64, time);
168+
170169
if (system_time_callback) {
171170
uint64_t system_time = system_time_callback();
172171
// System time has gone backwards
173172
if (system_time < current_time || system_time > current_time + SYSTEM_TIME_MAXIMUM_DIFF) {
174173
tr_error("FATAL: system time less than reference time or more than 12 months in future: %"PRIi64" reference time: %"PRIi64, system_time, current_time);
175174
return -1;
176175
}
177-
} else {
178-
current_time += FRAME_COUNTER_STORE_FORCE_INTERVAL + CURRENT_TIME_INCREMENT_VALUE;
179176
}
180177

181178
return 0;

0 commit comments

Comments
 (0)