]> git.meshlink.io Git - utcp/blobdiff - utcp.c
Reset the snd.nxt pointer when starting packet retransmission.
[utcp] / utcp.c
diff --git a/utcp.c b/utcp.c
index d846fb1965bd4384bef7239ae0781e08fb257d8f..7624aa576d39c8753c810cea4c4f8643c377d3d4 100644 (file)
--- a/utcp.c
+++ b/utcp.c
@@ -500,6 +500,7 @@ static void retransmit(struct utcp_connection *c) {
                                len--;
                                pkt->hdr.ctl |= FIN;
                        }
+                       c->snd.nxt = c->snd.una + len;
                        buffer_copy(&c->sndbuf, pkt->data, 0, len);
                        print_packet(c->utcp, "rtrx", pkt, sizeof pkt->hdr + len);
                        utcp->send(utcp, pkt, sizeof pkt->hdr + len);
@@ -988,7 +989,7 @@ reset:
 }
 
 int utcp_shutdown(struct utcp_connection *c, int dir) {
-       debug("%p shutdown %d at %u\n", c ? c->utcp : NULL, dir, c->snd.last);
+       debug("%p shutdown %d at %u\n", c ? c->utcp : NULL, dir, c ? c->snd.last : 0);
        if(!c) {
                errno = EFAULT;
                return -1;