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
This commit is contained in:
Christian Helmuth 2023-12-07 11:47:59 +01:00 committed by Norman Feske
parent ad92d799cd
commit 636f5dda29

View File

@ -1396,7 +1396,7 @@ void Interface::_handle_ip(Ethernet_frame &eth,
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"); }