Check for expected error and set LAN interface if none exist
@@ -268,11 +268,17 @@ pub fn ethernet_transform_mode(
return_codes.push(ret);
}
Err(e) => {
+ if e.to_string().contains("Entry not found") {
+ trace!("No LAN interfaces found, setting one now");
+ let ret = KI.set_uci_var("network.lan.ifname", &ifname);
+ return_codes.push(ret);
+ } else {
warn!("Trying to read lan ifname returned {:?}", e);
return_codes.push(Err(e));
}
}
}
+ }
// next we do some magic to listen on the interface after a minute
InterfaceMode::Mesh => {
let ret = KI.set_uci_var(&filtered_ifname, "interface");
