Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Hotfix/dev reset disconnect backhaul #1598

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions agent/src/beerocks/slave/agent_ucc_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ bool agent_ucc_listener::handle_dev_set_config(std::unordered_map<std::string, s
std::transform(backhaul_param.begin(), backhaul_param.end(), backhaul_param.begin(), ::tolower);
if (backhaul_param == DEV_SET_ETH) {
m_selected_backhaul = DEV_SET_ETH;
// add the iface to the bridge
auto db = AgentDB::get();
auto bridge = db->bridge.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 ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,19 @@ 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 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)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm wrong, but this might not be enough.

During initialization, backhaul_manager_thread reads what interfaces are in the bridge with network_utils::linux_get_iface_list_from_bridge and then configures the transport process with configure_ieee1905_transport_interfaces. Here you are removing an interface from the bridge but you are not re-configuring the transport process so it'll be unaware of the change. The same happens when you add a new interface to the bridge.

To fix this problem correctly, I think we should be monitoring the bridge for changes and automatically reconfigure the transport process, just in case the bridge is modified from outside prplMesh

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
Expand Down