If the application closed a channel, we keep the UTCP connection alive for
a bit longer to handle resends of FIN packets. However, if this is missed
for some reason, either because the FIN got lost or the peer ignored the
receive callback, and the peer is sending new data, we need to inform it
that we are no longer listening. To do this, send a RST back.
advanced = seqdiff(hdr.ack, c->snd.una);
if(advanced) {
+ if(c->reapable && !is_reliable(c)) {
+ // TODO: we should also send RST for reliable connections
+ goto reset;
+ }
+
// RTT measurement
if(c->rtt_start.tv_sec) {
if(c->rtt_seq == hdr.ack) {