mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/wireguard - Remove trailing spaces to address additional regression in https://github.com/opnsense/plugins/issues/3571
This commit is contained in:
committed by
Franco Fichtner
parent
20533c6651
commit
90a16b1fb8
@@ -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]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user