Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jan 2001 19:24:15 +0100 (CET)
From:      Martin Blapp <mb@imp.ch>
To:        freebsd-hackers@freebsd.org
Cc:        Adrian Chadd <adrian@freebsd.org>
Subject:   RE: linux_connect() is broken
Message-ID:  <Pine.BSF.4.21.0101211918350.10033-100000@levais.imp.ch>

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

Also have a look at:

http://www.FreeBSD.org/cgi/cvsweb.cgi/syssrc/sys/compat/
linux/common/linux_socket.c?rev=1.21.2.2
&content-type=text/x-cvsweb-markup&cvsroot=netbsd

(Add these three lines together)


There is a comment form linux_connect():

*/
 * We should only let this call succeed once per
 * non-blocking connect; however we don't have
 * a convenient place to keep that state..
 */

But - that's happening now exactly with patch1 (also included below)

kernel: LINUX: linux_connect( s(36), name(2ac40590), namelen(16) )=0;
kernel: LINUX: linux_send( s(36), buf(bc1fead0), len(30),
flags(00000000) )=0;
kernel: LINUX: linux_to_bsd_msg_flags( ret_flags(00000000) );
kernel: LINUX: linux_to_bsd_msg_flags( flags(00000000) );
kernel: LINUX: linux_recvfrom( s(36), buf(bc1ff768), len(1024),
    flags(00000000), from(bc1fe89c), fromlenaddr(bc1fe884) )=0;
kernel: LINUX: linux_socket( protocol(0), type(1), domain(2) )=0;
kernel: LINUX: linux_connect( s(36), name(08536880), namelen(16) )=36;
kernel: LINUX: linux_connect( s(36), name(085368d8), namelen(16) )=56;

First connect() succeeds, second gets EINPROGRESS, third gets EISCONN
and Staroffice works as it should with this patch.

--- sys/compat/linux/linux_socket.c     Sun Jan 21 03:10:45 2001
+++ sys/compat/linux/linux_socket.c     Sun Jan 21 02:59:44 2001
@@ -454,7 +454,7 @@
                                return (error);
 
                        p->p_retval[0] = stat;
-                       return (0);
+                       return (EISCONN);
                }
        }

Martin

Martin Blapp, mb@imp.ch
------------------------------------------------
Improware AG, UNIX solution and service provider
Zurlindenstrasse 29, 4133 Pratteln, Switzerland
Phone: +41 79 370 26 05, Fax: +41 61 826 93 01
------------------------------------------------



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?Pine.BSF.4.21.0101211918350.10033-100000>