Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Mar 2003 07:51:07 -0800
From:      "James Satterfield" <james@uberduper.com>
To:        "Stefan Farfeleder" <stefan@fafoe.dyndns.org>, <java@FreeBSD.ORG>
Subject:   Re: jdk14 MulticastSocket breakage
Message-ID:  <001c01c2e653$b2d67b70$0feba8c0@sphynx>
References:  <20030309022834.GA585@frog.fafoe>

next in thread | previous in thread | raw e-mail | index | archive | help
Stefan,
You are my new best friend! After making the change you suggested, DVArchive
FINALLY works on freebsd with the native jdk1.4.1.
Just wanted to say thank you.
James.

----- Original Message -----
From: "Stefan Farfeleder" <stefan@fafoe.dyndns.org>
To: <java@FreeBSD.ORG>
Sent: Saturday, March 08, 2003 6:28 PM
Subject: jdk14 MulticastSocket breakage


> [please CC me, thanks]
>
> Hi,
>
> I think I've found a bug in the java/jdk14 port.  The method
> java.net.MulticastSocket.joinGroup() always fails with
> "java.net.SocketException: Invalid argument" (a small program to
> demonstrate this can be found at
> http://stud3.tuwien.ac.at/~e0026813/FreeBSD/multicast.java ).
>
> With ktrace I've tracked this down to:
>
> 1216 java     CALL  setsockopt(0x6,0,0x1,0xbf8e5b80,0x8)
> 1216 java     RET   setsockopt -1 errno 22 Invalid argument
>
> Then I looked into the source code and found that
> bsd-jdk14-patches-3.tar.gz made these changes to
> j2se/src/solaris/native/java/net/PlainDatagramSocketImpl.c
>
> -       if (JVM_SetSockOpt(fd, IPPROTO_IP, (join ?
IP_ADD_MEMBERSHIP:IP_DROP_MEMBERSHIP),
> +// XXXBSD: fix for BSD (re-implement with KAME ?)
> +//     if (JVM_SetSockOpt(fd, IPPROTO_IP, (join ?
IP_ADD_MEMBERSHIP:IP_DROP_MEMBERSHIP),
> +       if (JVM_SetSockOpt(fd, IPPROTO_IP, (join ? 1 : 0),
>
> which I do not understand.  <netinet/in.h> has 12 for IP_ADD_MEMBERSHIP
> and 13 for IP_DROP_MEMBERSHIP, the 1 corresponds to IP_OPTIONS and
> causes the EINVAL failure.  Reverting these changes and recompiling
> jdk14 fixes the failure for me.
>
> The patch also changes IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMBERSHIP into
> 1 and 0 which seems bogus too.  These constants are available on Linux
> but not on FreeBSD; I think the values IPV6_JOIN_GROUP and
> IPV6_LEAVE_GROUP should be used instead.
>
> Regards,
> Stefan Farfeleder
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-java" in the body of the message
>
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001c01c2e653$b2d67b70$0feba8c0>