From owner-freebsd-emulation Mon Jul 15 4:17: 9 2002 Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5FA5437B400 for ; Mon, 15 Jul 2002 04:17:07 -0700 (PDT) Received: from sanmx03.sanyo.co.jp (sanmx04.sanyo.co.jp [134.180.230.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id E17C043E64 for ; Mon, 15 Jul 2002 04:17:05 -0700 (PDT) (envelope-from take@tk.hm.rd.sanyo.co.jp) Received: from sanmx03.sanyo.co.jp (localhost [127.0.0.1]) by localhost (Postfix) with ESMTP id 478396594F for ; Mon, 15 Jul 2002 20:17:00 +0900 (JST) Received: from mx-rdsrv.hr.rd.sanyo.co.jp (unknown [10.36.21.23]) by sanmx03.sanyo.co.jp (Postfix) with ESMTP id 88C3365949 for ; Mon, 15 Jul 2002 20:16:59 +0900 (JST) Received: (from root@localhost) by mx-rdsrv.hr.rd.sanyo.co.jp (8.10.2+Sun/3.7W) id g6FBGrg22226 for ; Mon, 15 Jul 2002 20:16:53 +0900 (JST) Received: from localhost [127.0.0.1] by mx-rdsrv.hr.rd.sanyo.co.jp with SMTP id WAA22225 ; Mon, 15 Jul 2002 20:16:53 +0900 Received: from pigeon.tk.hm.rd.sanyo.co.jp (pigeon.tk.hm.rd.sanyo.co.jp [134.180.122.33]) by condor.tk.hm.rd.sanyo.co.jp (8.11.6/3.7W) with ESMTP id g6FBGvk02861; Mon, 15 Jul 2002 20:16:57 +0900 (JST) Received: from localhost (aster.tk.hm.rd.sanyo.co.jp [134.180.122.42]) by pigeon.tk.hm.rd.sanyo.co.jp (8.9.3/3.7W) with ESMTP id UAA33647; Mon, 15 Jul 2002 20:16:56 +0900 (JST) Date: Mon, 15 Jul 2002 20:16:56 +0900 (JST) Message-Id: <20020715.201656.104025700.take@tk.hm.rd.sanyo.co.jp> To: emulation@FreeBSD.ORG Cc: take@tk.hm.rd.sanyo.co.jp Subject: linux's SO_REUSEADDR is BSD's SO_REUSEPORT From: Satoru Takeuchi X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello, Recently I had a problem with linux emulation. I used linux-jdk13. When I ran one network programming, it didn't work. So I searched the reason (because in Linux it worked), and found that among below source code. In FreeBSD CURRENT-5.0 /usr/src/sys/compat/linux/linux_socket.c : 145 case LINUX_SO_REUSEADDR: return (SO_REUSEADDR); These are man-pages of socket option in Linux and FreeBSD. Linux : > man 7 socket ... SO_REUSEADDR Indicates that the rules used in validating addresses supplied in a bind(2) call should allow reuse of local addresses. For PF_INET sockets this means that a socket may bind, except when there is an active listening socket bound to the address. When the listening socket is bound to INADDR_ANY with a specific port then it is not possible to bind to this port for any local address. FreeBSD : > man getsockopt ... SO_REUSEADDR enables local address reuse SO_REUSEPORT enables duplicate address and port bindings When I changed SO_REUSEADDR into SO_REUSEPORT, it finally worked! Is this problem already known ? I couldn't find. regards, --- Satoru Takeuchi / take@tk.hm.rd.sanyo.co.jp Sanyo R&D Digital System Research Center To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message