]> git.meshlink.io Git - meshlink/blobdiff - src/utcp.c
Ensure aux field is initialized in RST packets.
[meshlink] / src / utcp.c
index 8b3509ef0f5c376ee7b37640cb3c82dba1819df4..11a9eead2960ae33a7523280c950da26970b3ef4 100644 (file)
@@ -2072,6 +2072,9 @@ static bool reset_connection(struct utcp_connection *c) {
                return false;
        }
 
+       buffer_clear(&c->sndbuf);
+       buffer_clear(&c->rcvbuf);
+
        c->recv = NULL;
        c->poll = NULL;
 
@@ -2106,6 +2109,7 @@ static bool reset_connection(struct utcp_connection *c) {
        hdr.ack = c->rcv.nxt;
        hdr.wnd = 0;
        hdr.ctl = RST;
+       hdr.aux = 0;
 
        print_packet(c, "send", &hdr, sizeof(hdr));
        c->utcp->send(c->utcp, &hdr, sizeof(hdr));