net/wireguard - Remove trailing spaces to address additional regression in https://github.com/opnsense/plugins/issues/3571

This commit is contained in:
rfrederick
2023-08-31 07:10:38 +02:00
committed by Franco Fichtner
parent 20533c6651
commit 90a16b1fb8
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
@@ -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]);
}