From 8dac08e58d32e96bbc71ca8bdbdf9d65e742a43e Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Sun, 19 Aug 2012 06:16:20 +0000 Subject: [PATCH] outgoing: cut some slack in the "packet from future" check git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@661 3ce903b1-3385-4e86-93cd-f9a4a239f7ac --- src/outgoing.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/outgoing.c b/src/outgoing.c index 452fc5e..c5ed283 100644 --- a/src/outgoing.c +++ b/src/outgoing.c @@ -126,7 +126,10 @@ void process_outgoing(struct worker_t *self) hlog(LOG_ERR, "worker %d: process_outgoing got pbuf %d marked free, age %d (now %d t %d)\n%*s", self->id, pb->seqnum, tick - pb->t, tick, pb->t, pb->packet_len-2, pb->data); abort(); - } else if (pb->t > tick) { + } else if (pb->t > tick + 2) { + /* 1-second offset is normal in case of one thread updating tick earlier than another + * and a little thread scheduling luck + */ hlog(LOG_ERR, "worker %d: process_outgoing got packet %d from future with t %d > tick %d!\n%*s", self->id, pb->seqnum, pb->t, tick, pb->packet_len-2, pb->data); } else if (tick - pb->t > 5) {