From owner-freebsd-java Sun Mar 9 7:49: 8 2003 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 0897437B401 for ; Sun, 9 Mar 2003 07:49:06 -0800 (PST) Received: from smak.uberduper.com (12-213-188-143.client.attbi.com [12.213.188.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D19843F85 for ; Sun, 9 Mar 2003 07:49:05 -0800 (PST) (envelope-from james@uberduper.com) Received: from sphynx (unknown [192.168.235.15]) by smak.uberduper.com (Postfix) with ESMTP id 834FC9D405; Sun, 9 Mar 2003 07:49:09 -0800 (PST) Message-ID: <001c01c2e653$b2d67b70$0feba8c0@sphynx> From: "James Satterfield" To: "Stefan Farfeleder" , References: <20030309022834.GA585@frog.fafoe> Subject: Re: jdk14 MulticastSocket breakage Date: Sun, 9 Mar 2003 07:51:07 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 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 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" To: 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. 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