From 95831a51aa7b5a31f42e7aba08634cb078b64c28 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Wed, 28 Aug 2013 17:04:26 +0930 Subject: [PATCH] Don't schedule another poll if the interface is down --- overlay_interface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/overlay_interface.c b/overlay_interface.c index 59e69d74..c8679aca 100644 --- a/overlay_interface.c +++ b/overlay_interface.c @@ -757,8 +757,10 @@ static void overlay_interface_poll(struct sched_ent *alarm) if (interface->state==INTERFACE_STATE_UP && interface->destination->tick_ms>0 && interface->send_broadcasts){ + if (now >= interface->destination->last_tx+interface->destination->tick_ms) overlay_send_tick_packet(interface->destination); + alarm->alarm=interface->destination->last_tx+interface->destination->tick_ms; alarm->deadline=alarm->alarm+interface->destination->tick_ms/2; } @@ -773,7 +775,7 @@ static void overlay_interface_poll(struct sched_ent *alarm) break; } - if (alarm->alarm!=-1) { + if (alarm->alarm!=-1 && interface->state==INTERFACE_STATE_UP) { if (alarm->alarm < now) alarm->alarm = now; schedule(alarm);