Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Gateway from bootline

9 views
Skip to first unread message

Juergen Naumann

unread,
Sep 5, 2001, 4:08:13 PM9/5/01
to
Dear all

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

Leonid Rosenboim

unread,
Sep 6, 2001, 7:31:23 AM9/6/01
to
Try this from Shell:

-> 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...

James Marshall

unread,
Sep 6, 2001, 9:07:27 AM9/6/01
to
I found something similar. The cause appeared to be that the gateway is added, not as the default
route, but as a route to a network based on the class (A, B or C) of the host's IP address.

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 Marshall

unread,
Sep 7, 2001, 5:33:59 AM9/7/01
to
One other thing I forgot to mention. The other configlettes in target/config/comps/src/net
(usrDhcpcCfg.c, usrNetPPPBoot.c, usrNetSlipBoot.c) also have the same problem adding the gateway as
usrNetRemoteCfg.c has.

James.

0 new messages