From owner-svn-ports-all@freebsd.org Thu Mar 25 07:34:07 2021 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B418C5B2611; Thu, 25 Mar 2021 07:34:07 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F5cL74nPsz4g7Z; Thu, 25 Mar 2021 07:34:07 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 976A123432; Thu, 25 Mar 2021 07:34:07 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 12P7Y7AM072482; Thu, 25 Mar 2021 07:34:07 GMT (envelope-from decke@FreeBSD.org) Received: (from decke@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 12P7Y6OY072480; Thu, 25 Mar 2021 07:34:06 GMT (envelope-from decke@FreeBSD.org) Message-Id: <202103250734.12P7Y6OY072480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: decke set sender to decke@FreeBSD.org using -f From: Bernhard Froehlich Date: Thu, 25 Mar 2021 07:34:06 +0000 (UTC) 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 X-SVN-Group: ports-head X-SVN-Commit-Author: decke X-SVN-Commit-Paths: in head/net/wireguard-tools: . files X-SVN-Commit-Revision: 569184 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2021 07:34:07 -0000 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()