From 855089af8d4636572d287201917970bb65040c7f Mon Sep 17 00:00:00 2001 From: Takeshi Sakoda Date: Tue, 15 Jan 2019 14:10:59 +0900 Subject: [PATCH] tsch: fix for https://github.com/contiki-ng/contiki-ng/pull/769#discussion_r247239784 --- os/net/mac/tsch/tsch.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/os/net/mac/tsch/tsch.c b/os/net/mac/tsch/tsch.c index bb1018677..6278ce0dc 100644 --- a/os/net/mac/tsch/tsch.c +++ b/os/net/mac/tsch/tsch.c @@ -861,13 +861,12 @@ PROCESS_THREAD(tsch_send_eb_process, ev, data) while(1) { unsigned long delay; - if(tsch_is_associated && tsch_current_eb_period > 0) { + if(tsch_is_associated && tsch_current_eb_period > 0 #ifdef TSCH_RPL_CHECK_DODAG_JOINED /* Implementation section 6.3 of RFC 8180 */ - if(!TSCH_RPL_CHECK_DODAG_JOINED()) { - goto tsch_send_eb_skipped; - } + && TSCH_RPL_CHECK_DODAG_JOINED() #endif /* TSCH_RPL_CHECK_DODAG_JOINED */ + ) { /* Enqueue EB only if there isn't already one in queue */ if(tsch_queue_packet_count(&tsch_eb_address) == 0) { uint8_t hdr_len = 0; @@ -887,9 +886,6 @@ PROCESS_THREAD(tsch_send_eb_process, ev, data) } } } -#ifdef TSCH_RPL_CHECK_DODAG_JOINED -tsch_send_eb_skipped: -#endif /* TSCH_RPL_CHECK_DODAG_JOINED */ if(tsch_current_eb_period > 0) { /* Next EB transmission with a random delay * within [tsch_current_eb_period*0.75, tsch_current_eb_period[ */