Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 31 20:25:12 UTC 2020

Modified Files:
        src/sys/net: if_wg.c

Log Message:
wg: Just call callout_halt directly.

No functional change, just makes it easier to read where callout_halt
happens.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/net/if_wg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if_wg.c
diff -u src/sys/net/if_wg.c:1.39 src/sys/net/if_wg.c:1.40
--- src/sys/net/if_wg.c:1.39	Mon Aug 31 20:24:49 2020
+++ src/sys/net/if_wg.c	Mon Aug 31 20:25:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wg.c,v 1.39 2020/08/31 20:24:49 riastradh Exp $	*/
+/*	$NetBSD: if_wg.c,v 1.40 2020/08/31 20:25:11 riastradh Exp $	*/
 
 /*
  * Copyright (C) Ryota Ozaki <ozaki.ry...@gmail.com>
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.39 2020/08/31 20:24:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wg.c,v 1.40 2020/08/31 20:25:11 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -673,7 +673,6 @@ static void	wg_update_endpoint_if_necess
 
 static void	wg_schedule_rekey_timer(struct wg_peer *);
 static void	wg_schedule_session_dtor_timer(struct wg_peer *);
-static void	wg_stop_session_dtor_timer(struct wg_peer *);
 
 static bool	wg_is_underload(struct wg_softc *, struct wg_peer *, int);
 static void	wg_calculate_keys(struct wg_session *, const bool);
@@ -1394,7 +1393,7 @@ wg_handle_msg_init(struct wg_softc *wg, 
 		 * session, so clear it now.
 		 */
 		WG_TRACE("Session destroying, but force to clear");
-		wg_stop_session_dtor_timer(wgp);
+		callout_halt(&wgp->wgp_session_dtor_timer, NULL);
 		wg_clear_states(wgs);
 		wgs->wgs_state = WGS_STATE_UNKNOWN;
 	}
@@ -1531,13 +1530,6 @@ wg_schedule_handshake_timeout_timer(stru
 	mutex_exit(wgp->wgp_lock);
 }
 
-static void
-wg_stop_handshake_timeout_timer(struct wg_peer *wgp)
-{
-
-	callout_halt(&wgp->wgp_handshake_timeout_timer, NULL);
-}
-
 static struct socket *
 wg_get_so_by_af(struct wg_worker *wgw, const int af)
 {
@@ -1887,7 +1879,7 @@ wg_handle_msg_resp(struct wg_softc *wg, 
 	wg_clear_states(wgs);
 	WG_TRACE("WGS_STATE_ESTABLISHED");
 
-	wg_stop_handshake_timeout_timer(wgp);
+	callout_halt(&wgp->wgp_handshake_timeout_timer, NULL);
 
 	mutex_enter(wgp->wgp_lock);
 	wg_swap_sessions(wgp);
@@ -2308,13 +2300,6 @@ wg_schedule_session_dtor_timer(struct wg
 	callout_schedule(&wgp->wgp_session_dtor_timer, hz);
 }
 
-static void
-wg_stop_session_dtor_timer(struct wg_peer *wgp)
-{
-
-	callout_halt(&wgp->wgp_session_dtor_timer, NULL);
-}
-
 static bool
 sockaddr_port_match(const struct sockaddr *sa1, const struct sockaddr *sa2)
 {

Reply via email to