diff options
author | Christian Hesse <mail@eworm.de> | 2022-06-29 12:53:02 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-06-29 12:53:02 +0200 |
commit | ba34ee5cda2f9c10b7ce8664d9682a7e04790a51 (patch) | |
tree | 161bcd3df8de0e6b693a0b5756419bcaf4c4b224 /mod/bridge-port-vlan | |
parent | 6fdf115dcf08fc79ea509f641546965ee2193c80 (diff) |
mod/bridge-port-vlan: do not act on missing interface
Happens on broken configuration or early boot...
Diffstat (limited to 'mod/bridge-port-vlan')
-rw-r--r-- | mod/bridge-port-vlan | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mod/bridge-port-vlan b/mod/bridge-port-vlan index f8acca8..a79bda0 100644 --- a/mod/bridge-port-vlan +++ b/mod/bridge-port-vlan @@ -52,9 +52,12 @@ /ip/dhcp-client/disable $DHCPClient; :delay 200ms; } - /interface/ethernet/disable [ find where name=$BridgePortVal->"interface" ]; + :local Disable [ /interface/ethernet/find where name=$BridgePortVal->"interface" ]; + :if ([ :len $Disable ] > 0) do={ + /interface/ethernet/disable $Disable; + :set InterfaceReEnable ($InterfaceReEnable, $BridgePortVal->"interface"); + } /interface/bridge/port/set disabled=no pvid=$Vlan $BridgePort; - :set InterfaceReEnable ($InterfaceReEnable, $BridgePortVal->"interface"); } else={ $LogPrintExit2 debug $0 ("Interface " . $BridgePortVal->"interface" . " already connected to " . $ConfigTo . \ " vlan " . $Vlan . ".") false; |