nic_router: remove 'mac_first' attribute

Since the router MAC is allocated like the donwlink MACs it can't happen
anymore that these MACs clash, for instance due to nested routers. Thus,
the range of the MAC allocators of nested routers must not be exclusive
anymore which deprecates the 'mac_first' configuration attribute.

Issue #2795
This commit is contained in:
Martin Stein 2018-04-27 14:00:07 +02:00 committed by Christian Helmuth
parent e83f095fd2
commit 7085640f05
5 changed files with 3 additions and 12 deletions

View File

@ -121,7 +121,7 @@ Net::Root::Root(Entrypoint &ep,
Region_map &region_map)
:
Root_component<Session_component>(&ep.rpc_ep(), &alloc), _timer(timer),
_mac_alloc(config.mac_first()), _ep(ep), _router_mac(_mac_alloc.alloc()),
_mac_alloc(MAC_ALLOC_BASE), _ep(ep), _router_mac(_mac_alloc.alloc()),
_config(config), _buf_ram(buf_ram), _region_map(region_map),
_interfaces(interfaces)
{ }

View File

@ -136,6 +136,8 @@ class Net::Root : public Genode::Root_component<Session_component>
{
private:
enum { MAC_ALLOC_BASE = 0x02 };
Timer::Connection &_timer;
Mac_allocator _mac_alloc;
Genode::Entrypoint &_ep;

View File

@ -40,13 +40,6 @@
</xs:restriction>
</xs:simpleType><!-- Domain_name -->
<xs:simpleType name="Mac_address">
<xs:restriction base="xs:string">
<xs:minLength value="11"/>
<xs:maxLength value="17"/>
</xs:restriction>
</xs:simpleType><!-- Mac_address -->
<xs:simpleType name="Session_label">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
@ -158,7 +151,6 @@
</xs:element><!-- domain -->
</xs:choice>
<xs:attribute name="mac_first" type="Mac_address" />
<xs:attribute name="verbose" type="Boolean" />
<xs:attribute name="verbose_packets" type="Boolean" />
<xs:attribute name="verbose_domain_state" type="Boolean" />

View File

@ -52,7 +52,6 @@ Configuration::Configuration(Env &env,
_udp_idle_timeout (read_sec_attr(node, "udp_idle_timeout_sec", DEFAULT_UDP_IDLE_TIMEOUT_SEC )),
_tcp_idle_timeout (read_sec_attr(node, "tcp_idle_timeout_sec", DEFAULT_TCP_IDLE_TIMEOUT_SEC )),
_tcp_max_segm_lifetime(read_sec_attr(node, "tcp_max_segm_lifetime_sec", DEFAULT_TCP_MAX_SEGM_LIFETIME_SEC)),
_mac_first (mac_from_string(node.attribute_value("mac_first", Mac_string("02:02:02:02:02:00")).string())),
_node(node)
{
/* read domains */

View File

@ -43,7 +43,6 @@ class Net::Configuration
Genode::Microseconds const _udp_idle_timeout { DEFAULT_UDP_IDLE_TIMEOUT_SEC };
Genode::Microseconds const _tcp_idle_timeout { DEFAULT_TCP_IDLE_TIMEOUT_SEC };
Genode::Microseconds const _tcp_max_segm_lifetime { DEFAULT_TCP_MAX_SEGM_LIFETIME_SEC };
Mac_address const _mac_first { mac_from_string("02:02:02:02:02:00") };
Pointer<Report> _report { };
Pointer<Genode::Reporter> _reporter { };
Domain_tree _domains { };
@ -89,7 +88,6 @@ class Net::Configuration
Domain_tree &domains() { return _domains; }
Report &report() { return _report(); }
Genode::Xml_node node() const { return _node; }
Mac_address const &mac_first() const { return _mac_first; }
};
#endif /* _CONFIGURATION_H_ */