mirror of
https://github.com/opnsense/plugins.git
synced 2026-06-08 16:34:18 -04:00
wg - fix error when empty tunnel address in instance (#3638)
This commit is contained in:
parent
186ec0713f
commit
19eac172c8
1 changed files with 2 additions and 1 deletions
|
|
@ -69,7 +69,8 @@ function wg_start($server, $fhandle, $ifcfgflag = 'up')
|
|||
}
|
||||
mwexecf('/usr/bin/wg setconf %s %s', [$server->interface, $server->cnfFilename]);
|
||||
|
||||
foreach (explode(',', (string)$server->tunneladdress) as $alias) {
|
||||
/* The tunneladdress can be empty, so array_filter without callback filters empty strings out. */
|
||||
foreach (array_filter(explode(',', (string)$server->tunneladdress)) as $alias) {
|
||||
$proto = strpos($alias, ':') === false ? "inet" : "inet6";
|
||||
mwexecf('/sbin/ifconfig %s %s %s alias', [$server->interface, $proto, $alias]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue