]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
xdp-quic/kxdpgun: fix mem leaks
authorLibor Peltan <libor.peltan@nic.cz>
Fri, 8 Jul 2022 13:24:07 +0000 (15:24 +0200)
committerDaniel Salzman <daniel.salzman@nic.cz>
Sun, 24 Jul 2022 17:34:26 +0000 (19:34 +0200)
src/utils/kxdpgun/main.c

index f945d6c3138c2dbd618cefc1eacc81f5ce530a46..0f7ff2ae22dc8cd02c5c0ff70670d3eb1995ea82 100644 (file)
@@ -700,6 +700,13 @@ void *xdp_gun_thread(void *_ctx)
                        }
                }
 
+#ifdef ENABLE_QUIC
+               if (ctx->quic) {
+                       uint32_t closed, reset;
+                       (void)knot_xquic_table_sweep(quic_table, &closed, &reset);
+               }
+#endif // ENABLE_QUIC
+
                // speed and signal part
                uint64_t dura_exp = (local_stats.qry_sent * 1000000) / ctx->qps;
                duration = timer_end(&timer);
@@ -731,6 +738,14 @@ void *xdp_gun_thread(void *_ctx)
        knot_xdp_deinit(xsk);
 
        knot_tcp_table_free(tcp_table);
+#ifdef ENABLE_QUIC
+       knot_xquic_table_free(quic_table);
+       struct knot_quic_session *n, *nxt;
+       WALK_LIST_DELSAFE(n, nxt, quic_sessions) {
+               knot_xquic_session_load(NULL, n);
+       }
+       knot_xquic_free_creds(quic_creds);
+#endif // ENABLE_QUIC
 
        char recv_str[40] = "", lost_str[40] = "", err_str[40] = "";
        if (!(ctx->flags & KNOT_XDP_FILTER_DROP)) {