[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-java
Subject:    UDP problem fix patch for FreeBSD JDK131 patchset8
From:       daichi <daichi () FreeBSD ! ORG>
Date:       2002-10-28 12:07:02
[Download RAW message or body]

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 <errno.h>
-#include <netinet/in.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
+#include <netinet/in.h>
 #include <sys/socket.h>
 
 #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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic