nic_router: allow for config values of 0 seconds

Ref #3931
This commit is contained in:
Martin Stein 2020-11-12 10:37:02 +01:00 committed by Norman Feske
parent 7ac6f93838
commit a7b878cbb5

View File

@ -21,8 +21,8 @@ Microseconds Genode::read_sec_attr(Xml_node const node,
char const *name,
uint64_t const default_sec)
{
uint64_t sec = node.attribute_value(name, (uint64_t)0);
if (!sec) {
uint64_t sec = node.attribute_value(name, ~(uint64_t)0);
if (sec == ~(uint64_t)0) {
sec = default_sec;
}
return Microseconds(sec * 1000 * 1000);