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]); }