ping and ifconfig

I also found the invalid argument exception using ping on 0.1.10.

I have not been able to get net connectivity at all, please could you advise.

Platform: vmware 3.2.1, booted from jnode 0.1.10 iso image, vmware bridged networking on 192.168.0.0 network. eth0 is started

ifconfig returns
loopback: MAC-Address 00:00:00:00:00:00 MTUI 1500
null

eth0: MAC-Address 00:50:56:93:00:64 MTU 1500
null

Then I try 'ifconfig eth0 192.168.0.99' to assign an IP address ehich return 'IP address for eth0 set to null'

but now the eth0 entry from the ifconfig command returns:
eth0: MAC-Address 00:50:56:93:00:64 MTU 1500
192.168.0.99

when I try ping 192.168.0.1 command I get the inv arg exception, but on the previous release (0.1.9 built from source) it was a different message - NoRouteFoundToHost exception. I've tried playing with the 'route' command but this shouldn't be necessary as we are on the same subnet. (btw the -gw switch doesn't seem to be recognised).

Also I cannot ping 192.168.0.99 from 192.168.0.1

Please could someone explain what I need to do to get the network up and running.

The exception is very odd

This illegal argument exception, is very odd. It looks like it is thrown from a statement where ping tries to schedule a timed process to the VM after 5 seconds. The illegal argument is the variable that holds this portion of time, which is a static long with value 5000(ms) and definetly not negative.

For me it looks like a problem with the VM or a classpath implementation bug.

I am lookig further into it.

About the no route to host exceptions, ifconfig does not add the proper routes currently (it does not add any routes at all). You have to do it by hand.

It is also expected that you can't ping the JNode box from outside, if you do not have configured your interface AND routes (The ICMP protocol can't find a route to send you a reply).

Stacktrace

Hi

Please add the full stacktrace.

Ewout

Hi ewout

The problem is with the currentTimeMillis(), which returns negative time, which in turn creates problem to Timer.schedule() mehtod of classpath. The strange is that the date command works! I have added a line System.out.println(System.currentTimeMillis()); just before the call to Timer.schedule in ping and the time returned was negative.

The stacktrace is at http://pavlos.ath.cx:81/temp/ping_IllegalArgumentException.PNG

seems a classpath bug

in schedule(TimerTask task, long delay) the code
schedule(task, time, -1, false);
use -1 which is an illegal arg.

So, this method will always throw the exception !

Fabien

No you are wrong

No that's wrong. The 3rd parameter is the period parameter, which tells the scheduler to repeat this task every "period". The value -1 means that this task doesn't have to run more than once.

The negative parameter in our call is the 2nd, of private void schedule(TimerTask task, long time, long period, boolean fixed), because the public void schedule(TimerTask task, long delay) in line 551 of the Timer.java adds the specified delay with the current time from System.currentTimeMillis(), which in our case is a very small negative number (very big absolute number).

I am still curius, why the Date(long) constructor works fine. Maybe some convertions from long to int that take place in the computeFields() of Calendar class (used by Date) loose the sign of the number. Anyway, classpath looks fine. I have "backtracked" the problem to org.jnode.vm.VmSystem.currentTimeMillis(). I am afraid to go further Sticking out tongue . It's almost 2:00 here and I have to go to work tomorrow. :|

route

> I've tried playing with the 'route' command but this shouldn't be
>necessary as we are on the same subnet. (btw the -gw switch doesn't
>seem to be recognised).

You need a route even for the subnet you are in, but in other OS's this route is added automatically when you ifconfig a network card. JNode's ifconfig does not do this (yet) so that's why you have to add a route manually.
Andras

Startup Script

I can now create a routing table (syntax in user guide does not appear to work), assign an IP and add DNS servers. Works fine. How can I now either group the commands and execute them on startup or make the result of the commands the default on startup?

TODO

This is work in progress. In a while, these settings will be made persistent, so they survive a reboot.

Regards
Ewout

Exception trace

Please give the stacktrace of the exception you got.

Ewout