From 27cc0a402afc46a6a76c440e4568f73ff797a4ac Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Tue, 6 Dec 2016 12:51:58 +0100 Subject: [PATCH] NIC router: descriptive error on missing interface Previously, if a packet should be routed to a domain that had no interface connected, the NIC router only printed "Unroutable packet". Technically, this was wrong as an unavailable interface doesn't mean that the routing failed. Now it gives an error "no interface connected to domain". Ref #2193 --- repos/os/src/server/nic_router/interface.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/os/src/server/nic_router/interface.cc b/repos/os/src/server/nic_router/interface.cc index 1ace557f17..980c0ebbfc 100644 --- a/repos/os/src/server/nic_router/interface.cc +++ b/repos/os/src/server/nic_router/interface.cc @@ -350,7 +350,6 @@ void Interface::_handle_ip(Ethernet_frame ð, return; } catch (Forward_rule_tree::No_match) { } - catch (Pointer::Invalid) { } } /* try to route via transport and permit rules */ try { @@ -372,7 +371,6 @@ void Interface::_handle_ip(Ethernet_frame ð, } catch (Transport_rule_list::No_match) { } catch (Permit_single_rule_tree::No_match) { } - catch (Pointer::Invalid) { } /* try to route via IP rules */ try { @@ -388,7 +386,6 @@ void Interface::_handle_ip(Ethernet_frame ð, return; } catch (Ip_rule_list::No_match) { } - catch (Pointer::Invalid) { } /* give up and drop packet */ if (_config().verbose()) { @@ -550,6 +547,9 @@ void Interface::_handle_eth(void *const eth_base, catch (Domain::No_next_hop) { error("can not find next hop"); } + + catch (Pointer::Invalid) { + error("no interface connected to domain"); } }