Skip to content

Commit 91ca2e6

Browse files
author
Mika Leppänen
committed
Corrected KMP timer active check and security protocol address get
KMP timer active check is now made correctly. Added option to ask only local or remote address to security protocol address get.
1 parent 65d983f commit 91ca2e6

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

source/6LoWPAN/ws/ws_pae_lib.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,18 @@ bool ws_pae_lib_kmp_timer_update(kmp_list_t *kmp_list, uint16_t ticks, ws_pae_li
126126
return false;
127127
}
128128

129+
bool timer_running = false;
130+
129131
ns_list_foreach_safe(kmp_entry_t, entry, kmp_list) {
130132
if (entry->timer_running) {
131133
timeout(entry->kmp, ticks);
134+
timer_running = true;
132135
} else {
133136
break;
134137
}
135138
}
136139

137-
return true;
140+
return timer_running;
138141
}
139142

140143
void ws_pae_lib_supp_list_init(supp_list_t *supp_list)

source/Security/kmp/kmp_api.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,12 @@ static void kmp_sec_prot_eui64_addr_get(sec_prot_t *prot, uint8_t *local_eui64,
240240

241241
kmp->service->addr_get(kmp->service, kmp, &local_addr, &remote_addr);
242242

243-
memcpy(local_eui64, kmp_address_eui_64_get(&local_addr), 8);
244-
memcpy(remote_eui64, kmp_address_eui_64_get(&remote_addr), 8);
243+
if (local_eui64) {
244+
memcpy(local_eui64, kmp_address_eui_64_get(&local_addr), 8);
245+
}
246+
if (remote_eui64) {
247+
memcpy(remote_eui64, kmp_address_eui_64_get(&remote_addr), 8);
248+
}
245249
}
246250

247251
void kmp_api_delete(kmp_api_t *kmp)

0 commit comments

Comments
 (0)