svn commit: r569184 - in head/net/wireguard-tools: . files

Bernhard Froehlich decke at FreeBSD.org
Thu Mar 25 07:34:07 UTC 2021


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()


More information about the svn-ports-head mailing list