Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Mar 2021 07:34:06 +0000 (UTC)
From:      Bernhard Froehlich <decke@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r569184 - in head/net/wireguard-tools: . files
Message-ID:  <202103250734.12P7Y6OY072480@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: decke
Date: Thu Mar 25 07:34:06 2021
New Revision: 569184
URL: https://svnweb.freebsd.org/changeset/ports/569184

Log:
  net/wireguard-tools: Unload if_wg kernel module after stop if it was loaded
  
  This helps to reload also the kernel module after an update with a simple
  restart or stop/start of the service.

Modified:
  head/net/wireguard-tools/Makefile
  head/net/wireguard-tools/files/wireguard_lite.in
  head/net/wireguard-tools/files/wireguard_wgquick.in

Modified: head/net/wireguard-tools/Makefile
==============================================================================
--- head/net/wireguard-tools/Makefile	Thu Mar 25 03:40:32 2021	(r569183)
+++ head/net/wireguard-tools/Makefile	Thu Mar 25 07:34:06 2021	(r569184)
@@ -2,7 +2,7 @@
 
 PORTNAME=	wireguard-tools
 PORTVERSION=	1.0.20210315
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net net-vpn
 MASTER_SITES=	https://git.zx2c4.com/wireguard-tools/snapshot/
 

Modified: head/net/wireguard-tools/files/wireguard_lite.in
==============================================================================
--- head/net/wireguard-tools/files/wireguard_lite.in	Thu Mar 25 03:40:32 2021	(r569183)
+++ head/net/wireguard-tools/files/wireguard_lite.in	Thu Mar 25 07:34:06 2021	(r569184)
@@ -86,6 +86,13 @@ wireguard_stop()
 
 		ifconfig ${interface} destroy
 	done
+
+	if kldstat -q -n if_wg; then
+		if ! kldunload if_wg > /dev/null 2>&1; then
+			warn "Can't unload if_wg module."
+			return 1
+		fi
+	fi
 }
 
 wireguard_reload()

Modified: head/net/wireguard-tools/files/wireguard_wgquick.in
==============================================================================
--- head/net/wireguard-tools/files/wireguard_wgquick.in	Thu Mar 25 03:40:32 2021	(r569183)
+++ head/net/wireguard-tools/files/wireguard_wgquick.in	Thu Mar 25 07:34:06 2021	(r569184)
@@ -39,6 +39,13 @@ wireguard_stop()
 	for interface in ${wireguard_interfaces}; do
 		%%PREFIX%%/bin/wg-quick down ${interface}
 	done
+
+	if kldstat -q -n if_wg; then
+		if ! kldunload if_wg > /dev/null 2>&1; then
+			warn "Can't unload if_wg module."
+			return 1
+		fi
+	fi
 }
 
 wireguard_reload()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103250734.12P7Y6OY072480>