From owner-freebsd-hackers Tue May 7 18:39:27 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from web10408.mail.yahoo.com (web10408.mail.yahoo.com [216.136.130.110]) by hub.freebsd.org (Postfix) with SMTP id B25BE37B406 for ; Tue, 7 May 2002 18:39:19 -0700 (PDT) Message-ID: <20020508013918.49934.qmail@web10408.mail.yahoo.com> Received: from [63.113.218.99] by web10408.mail.yahoo.com via HTTP; Tue, 07 May 2002 18:39:18 PDT Date: Tue, 7 May 2002 18:39:18 -0700 (PDT) From: NITIN BAHADUR Subject: tcp socket connecting to itself To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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