classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in Java_gnu_java_net_PlainDatagramSocketImpl_receive0


From: Jaeyoun Chung
Subject: bug in Java_gnu_java_net_PlainDatagramSocketImpl_receive0
Date: Fri, 21 May 2004 09:50:58 +0900
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Hi there,

While running mauve test, I found the following errors which does not fixed in
classpath-0.9 release, either.

in native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c, 
Java_gnu_java_net_PlainDatagramSocketImpl_receive0() calls ntohs() on the port
before "setPort:(I)V" method call which is not correct.
_javanet_recvfrom() itself handles the endian conversions.

here's the patch.

diff -uu 
classpath-0.08/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c.\~1\~ 
classpath-0.08/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c
--- 
classpath-0.08/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c.~1~   
    2003-11-29 08:43:18.000000000 +0900
+++ classpath-0.08/native/jni/java-net/gnu_java_net_PlainDatagramSocketImpl.c   
2004-05-20 20:26:57.000000000 +0900
@@ -299,7 +299,7 @@
   DBG("PlainDatagramSocketImpl.receive(): Stored the address\n");
 
   /* Store the port */
-  port = ntohs(((unsigned short)port));
+  /* port = ntohs(((unsigned short)port)); */
 
   mid = (*env)->GetMethodID(env, cls, "setPort", "(I)V");
   if (mid == NULL)

Diff finished.  Fri May 21 09:48:55 2004





reply via email to

[Prev in Thread] Current Thread [Next in Thread]