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

Re: ICMP response gets lost



On Fri, Jul 05, 2002 at 01:07:16AM +0200, Steffen Beyer wrote:

> when I try to telnet (on an obsd 3.1 machine) to a closed port on a
> neighbour box, the port-unreachable response arrives, passes the pf
> but doesn't stop telnet (or bin/*) from trying.
> How can I find out where it gets stuck?

I just tried this and can confirm there's something going wrong.
According to Stevens' Vol. 2, the ICMP error should go through the
following parts of the kernel when it arrives:

  ipintr
  icmp_input
  tcp_ctlinput
  in_pcbnotify
  tcp_notify

and then cause a ECONNREFUSED to be delivered to the connecting TCP
socket.

For some reason, this doesn't happen here. Either the incoming ICMP
error fails some tests (which would be the fault of pf, generating an
invalid ICMP error message), or the stack itself does something wrong.

When you run netstat -s and watch for "icmp: Input packet histogram:
destination unreachable:", you see that the incoming ICMP port
unreachable is counted, so it makes it to icmp_input() fine.

I'll have to debug further to see where it gets dropped, but it sure
looks like a bug somewhere.

Daniel