diff --git a/agent/src/beerocks/slave/agent_ucc_listener.cpp b/agent/src/beerocks/slave/agent_ucc_listener.cpp index 6dbc52a352..46c7303528 100644 --- a/agent/src/beerocks/slave/agent_ucc_listener.cpp +++ b/agent/src/beerocks/slave/agent_ucc_listener.cpp @@ -216,6 +216,16 @@ bool agent_ucc_listener::handle_dev_set_config(std::unordered_mapbridge.iface_name; + auto eth_iface = db->ethernet.iface_name; + if (!network_utils::linux_add_iface_to_bridge(bridge, eth_iface)) { + LOG(ERROR) << "Failed to add iface '" << eth_iface << "' to bridge '" << bridge + << "' !"; + return false; + } + } else { // backhaul param must be a radio UID, in hex, starting with 0x if (backhaul_param.substr(0, 2) != "0x" || backhaul_param.size() != 14 || diff --git a/agent/src/beerocks/slave/backhaul_manager/backhaul_manager_thread.cpp b/agent/src/beerocks/slave/backhaul_manager/backhaul_manager_thread.cpp index 3a9721756b..c076b7ae4e 100644 --- a/agent/src/beerocks/slave/backhaul_manager/backhaul_manager_thread.cpp +++ b/agent/src/beerocks/slave/backhaul_manager/backhaul_manager_thread.cpp @@ -656,15 +656,29 @@ bool backhaul_manager::backhaul_fsm_main(bool &skip_select) // UCC FSM. If UCC is in RESET, we have to stay in (or move to) ENABLED state. if (m_agent_ucc_listener && m_agent_ucc_listener->is_in_reset()) { + auto active_hal = get_wireless_hal(); + if (active_hal) { + active_hal->disconnect(); + } + + auto db = AgentDB::get(); + auto bridge = db->bridge.iface_name; + auto bridge_ifaces = network_utils::linux_get_iface_list_from_bridge(bridge); + auto eth_iface = db->ethernet.iface_name; + // remove the wired interface from the bridge, it will be added on dev_set_config. + if (std::find(bridge_ifaces.begin(), bridge_ifaces.end(), eth_iface) != + bridge_ifaces.end()) { + if (!network_utils::linux_remove_iface_from_bridge(bridge, eth_iface)) { + LOG(ERROR) << "Failed to remove iface '" << eth_iface << "' from bridge '" << bridge + << "' !"; + return false; + } + } if (m_eFSMState == EState::ENABLED) { m_agent_ucc_listener->reset_completed(); // Stay in ENABLE state until onboarding_state will change return true; } else if (m_eFSMState > EState::ENABLED) { - auto active_hal = get_wireless_hal(); - if (active_hal) { - active_hal->disconnect(); - } FSM_MOVE_STATE(RESTART); } }