From owner-freebsd-java Mon Oct 28 4: 4:52 2002 Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A01BB37B401 for ; Mon, 28 Oct 2002 04:04:50 -0800 (PST) Received: from ongs.co.jp (ns.ongs.co.jp [202.216.232.58]) by mx1.FreeBSD.org (Postfix) with SMTP id 8F10D43E6E for ; Mon, 28 Oct 2002 04:04:49 -0800 (PST) (envelope-from daichi@freebsd.org) Received: (qmail 5836 invoked from network); 28 Oct 2002 11:59:54 -0000 Received: from unknown (HELO parancell.ongs.co.jp) (202.216.232.62) by ns.ongs.co.jp with SMTP; 28 Oct 2002 11:59:54 -0000 Date: Mon, 28 Oct 2002 21:07:02 +0900 From: daichi To: Greg Lewis Cc: freebsd-java@FreeBSD.ORG, java@jp.freebsd.org Subject: UDP problem fix patch for FreeBSD JDK131 patchset8 Message-Id: <20021028210702.77c49536.daichi@freebsd.org> Organization: FreeBSD Project X-Mailer: Sylpheed version 0.8.5 (GTK+ 1.2.10; i386-portbld-freebsd4.6) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi Greg :) This is udp problem fix patch for FreeBSD JDK131. Please merge this patch to next patchset8 or jdk13 ports. ---------------------------------------------------------------------- --- ../src/solaris/native/java/net/PlainDatagramSocketImpl.c.orig Sun May 6 21:27:32 2001 +++ ../src/solaris/native/java/net/PlainDatagramSocketImpl.c Mon Oct 28 19:54:10 2002 @@ -9,10 +9,10 @@ */ #include -#include #include #include #include +#include #include #include "jvm.h" @@ -489,7 +489,7 @@ strerror(errno)); return; } -#if defined(__linux__) && defined(SO_BROADCAST) +#if (defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && defined(SO_BROADCAST) { int t = 1; setsockopt(fd, SOL_SOCKET, SO_BROADCAST, (char*) &t, sizeof(int)); @@ -568,8 +568,10 @@ int tmp = (*env)->GetIntField(env, value, i_valueID); int arg = tmp ? -1: 0; - if (JVM_SetSockOpt(fd, SOL_SOCKET, SO_REUSEADDR, - (char *)&arg, sizeof(arg)) < 0) { + if ((JVM_SetSockOpt(fd, SOL_SOCKET, SO_REUSEADDR, + (char *)&arg, sizeof(arg)) < 0) || + (JVM_SetSockOpt(fd, SOL_SOCKET, SO_REUSEPORT, + (char *)&arg, sizeof(arg)) < 0)) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", strerror(errno)); } ---------------------------------------------------------------------- Mr. Zachary Pincus had pointed out this problem(2002/09/10). And Hideki KAWAI-san had pointed out this, too(2002/10/26). Their contents of indication are almost the same. I also checked the problem. http://www.freebsd.org/cgi/getmsg.cgi?fetch=26469+30997+/usr/local/www/db/text/2002/freebsd-java/20020915.freebsd-java http://home.jp.freebsd.org/cgi-bin/showmail/FreeBSD-users-jp/71564 http://home.jp.freebsd.org/cgi-bin/showmail/FreeBSD-users-jp/71568 In response, Tetsuo Suzuki-san taught us the solution today. http://home.jp.freebsd.org/cgi-bin/showmail/java/237 http://home.jp.freebsd.org/cgi-bin/showmail/java/238 The above patch is created according to his directions. As a result of my investigating, I think that the udp problem is repaired by the patch. Please merge this patch, Greg. Thanks. -- daichi@freebsd.org, http://people.freebsd.org/~daichi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message