Skip to content

Commit

Permalink
Corrected system time check function return values
Browse files Browse the repository at this point in the history
  • Loading branch information
Mika Leppänen committed Sep 2, 2021
1 parent 85358a6 commit edb8bec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/6LoWPAN/ws/ws_pae_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,11 +935,11 @@ static uint32_t ws_pae_auth_lifetime_system_time_check(pae_auth_t *pae_auth, int
if (pae_auth->system_time_diff > TIME_DIFFERENCE_THRESHOLD + seconds + dec_extra_seconds) {
time_diff = pae_auth->system_time_diff - seconds - dec_extra_seconds;
} else {
return 0;
return dec_extra_seconds;
}
pae_auth->system_time_diff = 0;

uint32_t new_dec_extra_seconds = 0;
uint32_t new_dec_extra_seconds = dec_extra_seconds;

if (time_diff > 0) {
/* If the system time has made a large jump then use the stored time to calculate the lifetime
Expand Down

0 comments on commit edb8bec

Please sign in to comment.