sculpt_manager: fix router label lookup

The commit "sculpt_manager: relax nic_drv policy label" introduced the use of
the "label_prefix" attribute instead of "label" for the uplink policy in the
NIC router. However, it missed an appropriate adaption of the lookup of that
attribute when the Sculpt manager has to decide which uplink is used in a
manually managed router config. This caused the uplink to disappear whenever a
user created a manually managed router config. This commit fixes the problem.

Issue #4660
Fixes #4695
This commit is contained in:
Martin Stein 2022-12-01 20:08:35 +01:00 committed by Norman Feske
parent f3fc11713a
commit f10c470969

View File

@ -174,13 +174,13 @@ void Sculpt::Network::_update_nic_target_from_config(Xml_node const &config)
if (uplink.attribute_value("domain", String<16>()) != "uplink")
return;
if (uplink.attribute_value("label", String<16>()) == "nic_drv -> ")
if (uplink.attribute_value("label_prefix", String<16>()) == "nic_drv -> ")
result = Nic_target::WIRED;
if (uplink.attribute_value("label", String<16>()) == "wifi_drv -> ")
if (uplink.attribute_value("label_prefix", String<16>()) == "wifi_drv -> ")
result = Nic_target::WIFI;
if (uplink.attribute_value("label", String<16>()) == "usb_net -> ")
if (uplink.attribute_value("label_prefix", String<16>()) == "usb_net -> ")
result = Nic_target::MODEM;
});
return result;