It turns out that when we get in RESET packets, we need to make them trigger both the conn_id on the SEND and RECV side. This means we must store two entries for each connection: CID and CID+1. We know that any end will send in on either of these, so as long as we just forward the packet to the right gen_utp_worker we are good to go. This patch alters the dispatcher so it correctly does this. We don't check the wrap-around case yet though. This has been postponed until later.
It turns out I know why it happens. We should probably mitigate the problem.
And verified the rwin test as well.
According to the spec, sending out a FIN packet should not bump the retransmit timer. Fix this.
We may end up with the last ACK delayed. When this happens, the ACK will have to be sent out from the DESTROY_DELAY or GOT_FIN states.
The estimation is in ms, but we are being sent in microseconds. This of course fails spectacularly. We have a protection on the RTT on 6 seconds. A couple of runs to the moon and back. This guard was tripped as we were off by a factor of thousand. The patch fixes this problem.