The logic to check whether we actually have something to retransmit was
wrong, causing retransmit() to bail out early without setting or resetting
the timer. This also caused utcp_timeout() to return a negative value.
}
static void retransmit(struct utcp_connection *c) {
- if(c->state == CLOSED || c->snd.nxt == c->snd.una)
+ if(c->state == CLOSED || c->snd.last == c->snd.una) {
+ debug("Retransmit() called but nothing to retransmit!\n");
+ stop_retransmit_timer(c);
return;
+ }
struct utcp *utcp = c->utcp;