nic_router: fix verbose_packets attribute

The default value of each <domain> is the <config> value. However, if
a <domain> local value is set, the <config> value doesn't affect this
value at all.

Fixes #2874
This commit is contained in:
Martin Stein 2018-06-18 19:12:53 +02:00 committed by Norman Feske
parent 0b8520a208
commit e139c52262
3 changed files with 16 additions and 20 deletions

View File

@ -467,28 +467,24 @@ Verbosity
~~~~~~~~~
This is how you can configure the routers verbosity on its environment LOG
session:
session (default values shown):
! <config verbose="yes">
! <config verbose="no">
Log router decisions and optional hints.
Whether to log router decisions and optional hints.
! <config verbose_packets="yes">
Log most important protocol header fields of each packet that is received or
sent by the router (ETH, IPv4, ARP, UDP, TCP, DHCP, ICMP).
! <config verbose_domain_state="yes">
Log most important changes in the state of a domain (number of nic sessions
connected, current IPv4 config).
! <config>
! <domain verbose_packets="yes" ... >
! <config verbose_packets="no" ... >
! <domain verbose_packets="no" ... />
! <config/>
Log most important protocol header fields of each packet that is received or
sent at a specific domain (ETH, IPv4, ARP, UDP, TCP, DHCP, ICMP).
Whether to log most important protocol header fields of each packet that is
received or sent (ETH, IPv4, ARP, UDP, TCP, DHCP, ICMP). The <config> value
affects all domains without a <domain> local value.
! <config verbose_domain_state="no">
Whether to log most important changes in the state of a domain (number of NIC
sessions connected, current IPv4 config).
Examples

View File

@ -203,8 +203,8 @@ Domain::Domain(Configuration &config, Xml_node const node, Allocator &alloc)
_ip_config(_node.attribute_value("interface", Ipv4_address_prefix()),
_node.attribute_value("gateway", Ipv4_address()),
Ipv4_address()),
_verbose_packets(_node.attribute_value("verbose_packets", false) ||
_config.verbose_packets()),
_verbose_packets(_node.attribute_value("verbose_packets",
_config.verbose_packets())),
_icmp_echo_server(_node.attribute_value("icmp_echo_server",
_config.icmp_echo_server())),
_label(_node.attribute_value("label", String<160>()).string())

View File

@ -92,7 +92,7 @@ class Net::Domain : public Domain_base,
Link_side_tree _icmp_links { };
Genode::size_t _tx_bytes { 0 };
Genode::size_t _rx_bytes { 0 };
bool const _verbose_packets { false };
bool const _verbose_packets;
bool const _icmp_echo_server;
Genode::Session_label const _label;