nic_bridge: fix reading of 'mac' attribute

Read as full MAC address and not as decimal uint8_t.

Issue #2837
This commit is contained in:
Martin Stein 2018-05-17 17:55:13 +02:00 committed by Christian Helmuth
parent 342bdaf4a2
commit cee0c86c3c
2 changed files with 11 additions and 4 deletions

View File

@ -155,3 +155,13 @@ Session_component::~Session_component() {
vlan().mac_list.remove(&_mac_node);
_unset_ipv4_node();
}
Net::Root::Root(Genode::Env &env, Net::Nic &nic, Genode::Allocator &md_alloc,
Genode::Xml_node config)
:
Genode::Root_component<Session_component>(env.ep(), md_alloc),
_mac_alloc(Mac_address(config.attribute_value("mac", Mac_address(DEFAULT_MAC)))),
_env(env),
_nic(nic),
_config(config) { }

View File

@ -245,10 +245,7 @@ class Net::Root : public Genode::Root_component<Net::Session_component>
public:
Root(Genode::Env &env, Net::Nic &nic, Genode::Allocator &md_alloc,
Genode::Xml_node config)
: Genode::Root_component<Session_component>(env.ep(), md_alloc),
_mac_alloc(Mac_address(config.attribute_value("mac", (Genode::uint8_t)DEFAULT_MAC))),
_env(env), _nic(nic), _config(config) { }
Genode::Xml_node config);
};
#endif /* _COMPONENT_H_ */