mirror of
https://github.com/unraid/webgui.git
synced 2026-04-24 11:19:25 -05:00
networking: use new macvtap network instead of macvlan
Minor fixes
This commit is contained in:
@@ -661,11 +661,11 @@
|
||||
$netmodel = $nic['model'] ?: 'virtio-net';
|
||||
|
||||
$net_res =$this->libvirt_get_net_res($this->conn, $nic['network']);
|
||||
$vhost = file_exists("/boot/config/network.cfg") && exec("grep -Po '^BRNICS\[0\]=\"\K[^\"]+' /boot/config/network.cfg")=='';
|
||||
$vhost = file_exists("/boot/config/network.cfg") && exec("grep -Po '^BRNICS\\[0\\]=\"\\K[^\"]+' /boot/config/network.cfg")=='';
|
||||
if ($vhost) {
|
||||
exec("ip -br a|grep -Po '^vhost[0-9][^@]*'",$br);
|
||||
} else {
|
||||
exec("brctl show | cut -f1| awk NF | sed -n '1!p'", $br);
|
||||
exec("brctl show|grep -Po '^(vir)?br[0-9]+(\.[0-9]+)?'", $br);
|
||||
}
|
||||
if ($nic["boot"] != NULL) $nicboot = "<boot order='".$nic["boot"]."'/>" ; else $nicboot = "" ;
|
||||
if($net_res) {
|
||||
|
||||
@@ -1066,10 +1066,10 @@ private static $encoding = 'UTF-8';
|
||||
function getValidNetworks() {
|
||||
global $lv;
|
||||
$arrValidNetworks = [];
|
||||
if (file_exists("/boot/config/network.cfg") && exec("grep -Po '^BRNICS\[0\]=\"\K[^\"]+' /boot/config/network.cfg")=='') {
|
||||
if (file_exists("/boot/config/network.cfg") && exec("grep -Pom1 '^BRNICS\\[0\\]=\"\\K[^\"]+' /boot/config/network.cfg")=='') {
|
||||
exec("ip -br a|grep -Po '^(virbr|vhost)[0-9][^@ ]*'",$arrBridges);
|
||||
} else {
|
||||
exec("brctl show|grep -Po '^(vir)?br\d\S*'", $arrBridges);
|
||||
exec("brctl show|grep -Po '^(vir)?br[0-9]+(\.[0-9]+)?'", $arrBridges);
|
||||
}
|
||||
if (!is_array($arrBridges)) {
|
||||
$arrBridges = [];
|
||||
|
||||
Reference in New Issue
Block a user