From e139c522622f8b9bbed806ad7cff469bd56d4cd2 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Mon, 18 Jun 2018 19:12:53 +0200 Subject: [PATCH] nic_router: fix verbose_packets attribute The default value of each is the value. However, if a local value is set, the value doesn't affect this value at all. Fixes #2874 --- repos/os/src/server/nic_router/README | 30 ++++++++++-------------- repos/os/src/server/nic_router/domain.cc | 4 ++-- repos/os/src/server/nic_router/domain.h | 2 +- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/repos/os/src/server/nic_router/README b/repos/os/src/server/nic_router/README index ee5658ab18..a02f113f01 100644 --- a/repos/os/src/server/nic_router/README +++ b/repos/os/src/server/nic_router/README @@ -467,28 +467,24 @@ Verbosity ~~~~~~~~~ This is how you can configure the routers verbosity on its environment LOG -session: +session (default values shown): -! +! -Log router decisions and optional hints. +Whether to log router decisions and optional hints. -! - -Log most important protocol header fields of each packet that is received or -sent by the router (ETH, IPv4, ARP, UDP, TCP, DHCP, ICMP). - -! - -Log most important changes in the state of a domain (number of nic sessions -connected, current IPv4 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 value +affects all domains without a local value. + +! + +Whether to log most important changes in the state of a domain (number of NIC +sessions connected, current IPv4 config). Examples diff --git a/repos/os/src/server/nic_router/domain.cc b/repos/os/src/server/nic_router/domain.cc index 7a175d41ed..a287a2f6e8 100644 --- a/repos/os/src/server/nic_router/domain.cc +++ b/repos/os/src/server/nic_router/domain.cc @@ -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()) diff --git a/repos/os/src/server/nic_router/domain.h b/repos/os/src/server/nic_router/domain.h index 2af1b5aa28..39c74eac58 100644 --- a/repos/os/src/server/nic_router/domain.h +++ b/repos/os/src/server/nic_router/domain.h @@ -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;