Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Mar 1999 06:26:09 +0200 (CEST)
From:      perhov@phys.ntnu.no
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        perhov@phys.ntnu.no
Subject:   kern/10826: TCP connection looped back to itself
Message-ID:  <199903280426.GAA95143@fimfpc19.math.ntnu.no>

next in thread | raw e-mail | index | archive | help

>Number:         10826
>Category:       kern
>Synopsis:       TCP connection looped back to itself
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 27 20:30:00 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Per Kristian Hove
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
Norwegian University of Science and Technology
>Environment:

FreeBSD 3.1-STABLE as of Mon Mar 15 13:47:02 CET 1999

>Description:

On rare occations, a "telnet localhost N" (where N is an unused
port number >1024) will succeed and result in a connection looped
back to itself.

>How-To-Repeat:

Try hard enough, and you will get a connection. The connection
seems to be looped back into itself (hey, isn't that WYSIWYG?
"What You Send Is What You Get"?). The following example assumes
your shell is bash:

$ declare -i n=0
$ until telnet localhost 1234; do n=n+1; done;  echo n=$n
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
  [...]
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Connected to localhost.
Escape character is '^]'.
hi, am I talking to myself?             # I type this,
hi, am I talking to myself?             # this is the response I get


^]					# quit telnet
telnet> quit
Connection closed.
n=398
(Sometimes I have to wait until n=5000 before it occurs)

A output of 'netstat' shows that the connection is indeed looped:

# netstat
Active Internet connections
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp        0      0  localhost.1234         localhost.1234         ESTABLISHED
Active UNIX domain sockets
Address  Type   Recv-Q Send-Q    Inode     Conn     Refs  Nextref Addr
  [...]

This behaviour also occurs when I try to telnet to an IP address
assigned to another of the host's network interfaces (it doesn't have
to be the loopback interface).

I've never succeeded getting a connection to an unused port below 1024.

>Fix:
	
	


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903280426.GAA95143>