I'm writing a little program using TCP sockets for communication
between a CPU board and a server machine (Motorola MVME2400,
T2, vxWorks 5.4). By accident I found out that the program only works
with server machines being in the same subnet. Further investigations
showed that the gateway is set to the boards IP address although it
is given correctly in the bootline. My further observations:
* Print statements in bootConfig.c show that the gateway is read
correctly from the bootline and set with routeAdd.
* A print statement in usrAppInit.c gives the boards IP address as
the gateway address.
* After deleting this entry with routeDelete and reseting it correctly
with routeAdd in usrAppInit.c a routeShow gives the correct address.
* Typing routeShow in the host shell again gives the boards IP address
as the gateway and pinging an "out of subnet" machine does not work.
* After doing the routeDelete-routeAdd-gymnastics in the shell the
gateway is set correctly, stays correctly and ping work fine.
Does anyone of you has an idea what goes wrong before?
Thanks in advance,
--
Jürgen Naumann
e----------------------------->H1<---------------------------p
-> routeAdd("0","-gatyway-");
replace -gateway- with your router IP address.
HTH
"Juergen Naumann" <nau...@physik.uni-dortmund.de> wrote in message
news:9n60nd$o7e$1...@nx6.HRZ.Uni-Dortmund.DE...
This has some problems:
- class A/B/C has been replaced by variable-length subnet masks
- inet_netof_string() doesn't handle subnet masks
- a single gateway is usually added as the default route (0.0.0.0)
I edited the configlette (usrNetRemoteCfg.c) to add the gateway as the default route, since that
seemed more like common sense to me. At the time I also found out about the newer interface for
adding routes: mRouteXxx routines. routeAdd is a hangover from the old Net/1 network stack (used in
VxWorks 5.1.1 for example) whereas mRouteXxx is for the current Net/3 (BSD4.4-based) stack.
James Marshall.
James.