From owner-freebsd-emulation@FreeBSD.ORG Mon Sep 22 05:46:05 2003 Return-Path: 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 541D116A4B3 for ; Mon, 22 Sep 2003 05:46:05 -0700 (PDT) Received: from imf22aec.mail.bellsouth.net (imf22aec.mail.bellsouth.net [205.152.59.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0264E43FDF for ; Mon, 22 Sep 2003 05:46:04 -0700 (PDT) (envelope-from wsware@bellsouth.net) Received: from mail.bellsouth.net ([205.152.59.156]) by imf22aec.mail.bellsouth.netSMTP <20030922124603.ICIL13391.imf22aec.mail.bellsouth.net@mail.bellsouth.net> for ; Mon, 22 Sep 2003 08:46:03 -0400 X-Mailer: Openwave WebEngine, version 2.8.11 (webedge20-101-194-20030622) From: Scott Ware To: Date: Mon, 22 Sep 2003 8:46:02 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-Id: <20030922124603.ICIL13391.imf22aec.mail.bellsouth.net@mail.bellsouth.net> Subject: Linux SO_REUSEADDR or SO_REUSEPORT X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2003 12:46:05 -0000 I was trying to use a Linux program the reused a port it listens on and it always failed to bind under FreeBSD. I stumbled accross this in Google: http://groups.google.com/groups?q=linux_so_reuseaddr&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=20020715.201656.104025700.take_tk.hm.rd.sanyo.co.jp%40ns.sol.net&rnum=1 So I changed: /usr/src/sys/compat/linux/linux_socket.c : 145 case LINUX_SO_REUSEADDR: return (SO_REUSEADDR); to: /usr/src/sys/compat/linux/linux_socket.c : 145 case LINUX_SO_REUSEADDR: return (SO_REUSEPORT); And the program now works! Is this bad Linux coding or a bug in the FreeBSD Linux emulation? FreeBSD 4.8 linux_base-8-8.0_1