From ba34ee5cda2f9c10b7ce8664d9682a7e04790a51 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Jun 2022 12:53:02 +0200 Subject: mod/bridge-port-vlan: do not act on missing interface Happens on broken configuration or early boot... --- mod/bridge-port-vlan | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mod/bridge-port-vlan') 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; -- cgit v1.2.3-70-g09d2