[kaffe] Re: NetworkInterface problem

Ito Kazumitsu kaz at maczuka.gcd.org
Sun Apr 24 14:59:18 PDT 2005


From: Ito Kazumitsu <kaz at maczuka.gcd.org>
Subject: NetworkInterface problem (Re: [kaffe] freebsd 5.3 failed regression)
Date: Sun, 24 Apr 2005 23:07:48 +0900 (JST)

> The problem seems to appear when a network interface has more than
> one addresses.

The differnce between Kaffe's java.net.NetworkInterface and
that of GNU classpath is that Kaffe's has a private method
"condense" which condenses the output from
VMNetworkInterface.getInterfaces().

The output from VMNetworkInterface.getInterfaces() may be
something like this.

   ((name1 addr11) (name1 addr12) (name1 addr13)
    (name2 addr21) (name2 addr22))

condense condenses this into

   ((name1 (addr11 addr12 addr13))
    (name2 (addr21 addr22)))

>   (1) NetworkInterface returned by NetworkInterface.getNetworkInterfaces()
>       contains all addresses of that interface.

NetworkInterface.getNetworkInterfaces() returns the the condensed
result.
 
>   (2) NetworkInterface returned by NetworkInterface.getByName(name) or
>       NetworkInterface.getByInetAddress(addr) contains only one of the
>       addresses of that interface.

Until recently, these methods used getNetworkInterfaces() which
returned a condensed result.  But now they do not call
getNetworkInterfaces() but calls VMNetworkInterface.getInterfaces()
which may return one of uncondensed raw results.

The fix may be either

  (a) To modify java.net.NetworkInterface so that getByName or
      getByInetAddress calls getNetworkInterfaces() as before.

or

  (b) To modify libraries/clib/net/NetworkInterface.c so that
      java_net_VMNetworkInterface_getInterfaces returns already
      condensed results.

(a) is easier, but the difference between Kaffe and GNU Classpath
remains.  (b) is harder, but we will be able to  synchronize
java.net.NetworkInterface with GNU Classpath.




More information about the kaffe mailing list