net: contiki: Fix timer callback condition

etimer_expired will return true only once. This means periodic timers in
the netstack won't get to run since etimer_process calls etimer_expired
for all timers in the stack.

Jira: ZEP-475

Change-Id: I28da638789b0604f9dd0a0598a7fa590e6b0a746
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
This commit is contained in:
Jaakko Hannikainen 2016-08-02 14:47:36 +03:00 committed by Inaky Perez-Gonzalez
commit f77191976a

View file

@ -423,7 +423,7 @@ eventhandler(process_event_t ev, process_data_t data, struct net_buf *buf)
/* Check the clock so see if we should call the periodic uIP
processing. */
if(data == &periodic &&
etimer_expired(&periodic) && !etimer_is_triggered(&periodic)) {
!etimer_is_triggered(&periodic)) {
etimer_set_triggered(&periodic);
#if UIP_TCP
for(i = 0; i < UIP_CONNS; ++i) {
@ -455,7 +455,6 @@ eventhandler(process_event_t ev, process_data_t data, struct net_buf *buf)
* check the timer for reassembly
*/
if(data == &uip_reass_timer &&
etimer_expired(&uip_reass_timer) &&
!etimer_is_triggered(&uip_reass_timer)) {
etimer_set_triggered(&uip_reass_timer);
uip_reass_over();
@ -473,7 +472,6 @@ eventhandler(process_event_t ev, process_data_t data, struct net_buf *buf)
}*/
#if !UIP_CONF_ROUTER
if(data == &uip_ds6_timer_rs &&
etimer_expired(&uip_ds6_timer_rs) &&
!etimer_is_triggered(&uip_ds6_timer_rs)) {
etimer_set_triggered(&uip_ds6_timer_rs);
uip_ds6_send_rs(buf);
@ -481,7 +479,6 @@ eventhandler(process_event_t ev, process_data_t data, struct net_buf *buf)
}
#endif /* !UIP_CONF_ROUTER */
if(data == &uip_ds6_timer_periodic &&
etimer_expired(&uip_ds6_timer_periodic) &&
!etimer_is_triggered(&uip_ds6_timer_periodic)) {
etimer_set_triggered(&uip_ds6_timer_periodic);
uip_ds6_periodic(buf);