From 9b936dd1203a2e1367255bcbb915a1dd72c72367 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Mon, 26 Mar 2018 18:32:34 +0200 Subject: [PATCH] nic_router: packet verbose at detached interfaces The 'verbose packets' output previously was not generated for Interfaces without a domain. But this is desirable as the router nonetheless receives packets at such interfaces. This is now fixed and such output is simply prefixed with a "[?]" denoting that the interface has no domain. Issue #2732 --- repos/os/src/server/nic_router/interface.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repos/os/src/server/nic_router/interface.cc b/repos/os/src/server/nic_router/interface.cc index bcd3b2c140..b3bc19501c 100644 --- a/repos/os/src/server/nic_router/interface.cc +++ b/repos/os/src/server/nic_router/interface.cc @@ -1142,8 +1142,13 @@ void Interface::_handle_eth(void *const eth_base, error("failed to allocate IP for DHCP client"); } } catch (Pointer::Invalid) { + + if (_config().verbose_packets()) { + Ethernet_frame *const eth = reinterpret_cast(eth_base); + log("[?] rcv ", *eth); + } if (_config().verbose()) { - log("(?) Drop packet: no domain"); + log("[?] Drop packet: no domain"); } } }