aboutsummaryrefslogtreecommitdiffstats
path: root/src/if_wg.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/if_wg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/if_wg.c b/src/if_wg.c
index a6e19d6..73248a6 100644
--- a/src/if_wg.c
+++ b/src/if_wg.c
@@ -234,7 +234,6 @@ struct wg_peer {
};
struct wg_socket {
- struct mtx so_mtx;
struct socket *so_so4;
struct socket *so_so6;
uint32_t so_user_cookie;
@@ -483,6 +482,9 @@ wg_peer_free_deferred(struct noise_remote *r)
counter_u64_free(peer->p_tx_bytes);
counter_u64_free(peer->p_rx_bytes);
rw_destroy(&peer->p_endpoint_lock);
+ mtx_destroy(&peer->p_handshake_mtx);
+
+ cookie_maker_free(&peer->p_cookie);
free(peer, M_WG);
}
@@ -2891,6 +2893,8 @@ wg_clone_destroy(struct ifnet *ifp)
rn_detachhead((void **)&sc->sc_aip4);
rn_detachhead((void **)&sc->sc_aip6);
+ cookie_checker_free(&sc->sc_cookie);
+
if (cred != NULL)
crfree(cred);
if_detach(sc->sc_ifp);