Orchestra: fix bug in new_time_source

This commit is contained in:
Simon Duquennoy 2016-05-20 13:40:50 +02:00
parent 287b4767e3
commit 7e8d042609

View File

@ -176,13 +176,14 @@ static void
new_time_source(const struct tsch_neighbor *old, const struct tsch_neighbor *new)
{
if(new != old) {
const linkaddr_t *old_addr = old != NULL ? &old->addr : NULL;
const linkaddr_t *new_addr = new != NULL ? &new->addr : NULL;
if(new_addr != NULL) {
linkaddr_copy(&orchestra_parent_linkaddr, new_addr);
} else {
linkaddr_copy(&orchestra_parent_linkaddr, &linkaddr_null);
}
remove_uc_link(new_addr);
remove_uc_link(old_addr);
add_uc_link(new_addr);
}
}