From 636f5dda297d87808e46d6622294c3710e495b96 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Thu, 7 Dec 2023 11:47:59 +0100 Subject: [PATCH] nic_router: specify ICMP Destination (host) unreachable According to RFC 1812 ICMP Destination unreachable (Network unreachable) does not quite our case of clients directly behind the router. If a packet is to be forwarded to a host on a network that is directly connected to the router (i.e., the router is the last-hop router) and the router has ascertained that there is no path to the destination host then the router MUST generate a Destination Unreachable, Code 1 (Host Unreachable) ICMP message. Issue #4729 --- repos/os/src/server/nic_router/interface.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/os/src/server/nic_router/interface.cc b/repos/os/src/server/nic_router/interface.cc index 826b5c080b..a90985e826 100644 --- a/repos/os/src/server/nic_router/interface.cc +++ b/repos/os/src/server/nic_router/interface.cc @@ -1396,7 +1396,7 @@ void Interface::_handle_ip(Ethernet_frame ð, if(not ip.dst().is_multicast()) { _send_icmp_dst_unreachable(local_intf, eth, ip, - Icmp_packet::Code::DST_NET_UNREACHABLE); + Icmp_packet::Code::DST_HOST_UNREACHABLE); } if (_config().verbose()) { log("[", local_domain, "] unroutable packet"); }