Kernel: Print to debug log ICMP unreachable messages
These messages should be forwarded to underlying sockets
This commit is contained in:
parent
6ebfe05fce
commit
efdc4817bb
|
@ -18,6 +18,7 @@ namespace Kernel
|
|||
enum ICMPType : uint8_t
|
||||
{
|
||||
EchoReply = 0x00,
|
||||
DestinationUnreachable = 0x03,
|
||||
EchoRequest = 0x08,
|
||||
};
|
||||
|
||||
|
|
|
@ -212,6 +212,13 @@ namespace Kernel
|
|||
TRY(interface.send_bytes(dst_mac, EtherType::IPv4, packet));
|
||||
break;
|
||||
}
|
||||
case ICMPType::DestinationUnreachable:
|
||||
{
|
||||
auto& ipv4_header = ipv4_data.slice(sizeof(ICMPHeader)).as<const IPv4Header>();
|
||||
dprintln("Destination '{}' unreachable, code {2H}", ipv4_header.dst_address, icmp_header.code);
|
||||
// FIXME: inform the socket
|
||||
break;
|
||||
}
|
||||
default:
|
||||
dprintln("Unhandleded ICMP packet (type {2H})", icmp_header.type);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue