From 90a16b1fb87c8b0a2866f7c070f4a3c82096344d Mon Sep 17 00:00:00 2001 From: rfrederick Date: Wed, 30 Aug 2023 15:54:12 -0500 Subject: [PATCH] net/wireguard - Remove trailing spaces to address additional regression in https://github.com/opnsense/plugins/issues/3571 --- net/wireguard/Makefile | 2 +- .../src/opnsense/scripts/Wireguard/wg-service-control.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/wireguard/Makefile b/net/wireguard/Makefile index 34ce6b071..e597f4f97 100644 --- a/net/wireguard/Makefile +++ b/net/wireguard/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= wireguard PLUGIN_VERSION= 2.0 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= WireGuard VPN service kernel implementation PLUGIN_DEPENDS= wireguard-kmod PLUGIN_CONFLICTS= wireguard-go diff --git a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php index af0bbe7bd..7e6c57a09 100755 --- a/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php +++ b/net/wireguard/src/opnsense/scripts/Wireguard/wg-service-control.php @@ -67,7 +67,7 @@ function wg_start($server, $fhandle) continue; } foreach (explode(',', (string)$client->tunneladdress) as $tunneladdress) { - $ipproto = strpos($tunneladdress, ":") === false ? "inet" : "inet6 "; + $ipproto = strpos($tunneladdress, ":") === false ? "inet" : "inet6"; /* wg-quick seems to prevent /0 being routed and translates this automatically */ if (str_ends_with(trim($tunneladdress), '/0')) { if ($ipproto == 'inet') { @@ -87,7 +87,7 @@ function wg_start($server, $fhandle) } } elseif (!empty((string)$server->gateway)) { /* Only bind the gateway ip to the tunnel */ - $ipprefix = strpos($tunneladdress, ":") === false ? "-4" : "-6 "; + $ipprefix = strpos($tunneladdress, ":") === false ? "-4" : "-6"; mwexecf('/sbin/route -q -n add %s %s -iface %s', [$ipprefix, $server->gateway, $server->interface]); }