Avoid tsch crash when loosing timesource
This commit is contained in:
parent
0adc6bfbad
commit
c33c10540a
|
@ -304,6 +304,7 @@ keepalive_send(void *ptr)
|
||||||
{
|
{
|
||||||
if(tsch_is_associated) {
|
if(tsch_is_associated) {
|
||||||
struct tsch_neighbor *n = tsch_queue_get_time_source();
|
struct tsch_neighbor *n = tsch_queue_get_time_source();
|
||||||
|
if(n != NULL) {
|
||||||
/* Simply send an empty packet */
|
/* Simply send an empty packet */
|
||||||
packetbuf_clear();
|
packetbuf_clear();
|
||||||
packetbuf_set_addr(PACKETBUF_ADDR_RECEIVER, &n->addr);
|
packetbuf_set_addr(PACKETBUF_ADDR_RECEIVER, &n->addr);
|
||||||
|
@ -311,6 +312,9 @@ keepalive_send(void *ptr)
|
||||||
LOG_INFO("sending KA to ");
|
LOG_INFO("sending KA to ");
|
||||||
LOG_INFO_LLADDR(&n->addr);
|
LOG_INFO_LLADDR(&n->addr);
|
||||||
LOG_INFO_("\n");
|
LOG_INFO_("\n");
|
||||||
|
} else {
|
||||||
|
LOG_INFO("no timesource - KA not sent\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in New Issue