Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 May 2002 18:39:18 -0700 (PDT)
From:      NITIN BAHADUR <nitin_bahadur@yahoo.com>
To:        freebsd-hackers@freebsd.org
Subject:   tcp socket connecting to itself
Message-ID:  <20020508013918.49934.qmail@web10408.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
Hi,
    I am facing a connect problem which is related to
"closed" bug
# 10826. Here's what I am doing...

    My client program is trying to connect to a server
(on same
machine as client) while my server is down. My server
port is > 1024
(say 2000). (the client program doesn't do a bind).

     If I run my client program in a loop trying to
connect to the
server, then eventually, the kernel connect code
assigns it a local
port of 2000 and the "connect succeeds" even when the
server is down.
Thus I am connected to myself on the same port.

    Now the bug report 10826 dismisses this as 

   "This is a closed issue. 
    TCP has the property that it will allow "symmetric
opens". 
    Read various classics on the topic."

 I went through the TCP RFC and I think i understand
what they
mean about symmetric opens. But in my case, my
src_ip == destn_ip && src_port == destn_port

  If this is a valid implementation of TCP and there
is nothing
wrong in this, then why don't books on network
programming mention
that after doing a "connect" verify that you are not
connected to
yourself.

  Its easy for me to fix my code to check if i am
connected to
myself. But I want to know if this is correct ??

thanks
nitin


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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




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