bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ICMPv4 Type 3 Code 13 not implemented


From: Erik Auerswald
Subject: Re: ICMPv4 Type 3 Code 13 not implemented
Date: Mon, 23 Jan 2023 09:14:31 +0100

Hi,

On Sat, Jan 21, 2023 at 04:16:59PM +0000, Marco wrote:
> 
> inetutils-telnet doesn't seem to implement ICMPv4 correctly.

The telnet client does not use ICMP directly.

> It doesn't print a proper message when ICMPv4 Type 3 Code 13 is being
> received, only "no route to destination".

When telnet cannot connect to a remote server, it uses perror(3) to
print the error message associated with the failed connect(2) syscall.
The telnet client does not control the contents of that error message.

> Please see this RFC
> https://datatracker.ietf.org/doc/html/rfc1812#section-5.2.7.1
> 
> There should be a proper message according to the specific code.

I do not think adding complexity and privileges in order to handle ICMP
in the telnet client instead of relying on the OS would be an improvement,
quite the contrary.

The Linux connect(2) syscall seems to only support "ENETUNREACH" for any
unreachable destination.  POSIX also allows "EHOSTUNREACH."  But even
this just allows to distinguish between network and host unreachable,
not between all the different reasons defined for ICMP.  If OS kernels
and C libraries would be extended to support more of the ICMP errors,
that would help every program using connect(2) and perror(3) to produce
more appropriate error messages.

Kind regards,
Erik
-- 
A distributed system is one in which the failure of a computer you didn't
even know existed can render your own computer unusable.
                        -- Leslie Lamport



reply via email to

[Prev in Thread] Current Thread [Next in Thread]