This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: IP configuration
- From: Andrew Lunn <andrew at lunn dot ch>
- To: raghuram <rram at globaledgesoft dot com>
- Cc: "Ecos-Discuss (E-mail)" <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 13 Oct 2004 09:48:53 +0200
- Subject: Re: [ECOS] IP configuration
- References: <416A1864.4010707@eCosCentric.com> <003701c4af54$a2055a70$d60610ac@rramxp>
On Mon, Oct 11, 2004 at 11:09:09AM +0530, raghuram wrote:
>
> > Hello,
> > I am running eCOS on a WLAN board with ARM9 processor. I wanted to run a
> > client-server application with client application on a linux host ( IP
> > address 172.16.6.20)and server application on the WLAN board connected
> > through a cross-cable.
> > I am also running GoAhead web server on the board. Now using the webserver
> I
> > am able to configure IP address, Subnet Mask, default Gateway address as
> per
> > my requirements. The default IP address of the board (Factory setting) is
> > 192.168.0.10
> >
> > 1.0 .First I tried changing the IP address in line with my local LAN
> > (172.16.6.10). Made the board as host in my LAN. I could browse the
> > webserver from any host in my LAN.
> >
> > 2.0 Then I connect my linux host and the board through cross-cable. I
> loaded
> > the image with server application on board and linux host running client
> > application.
> > Now I faced some problem in "bind" system call. When I used the IP
> address
> > of the board (172.16.6.10) to the sockaddr structure, I got an error bind
> > failing and saying "Can't assign the requested IP address". Following is
> the
> > piece of code for your reference which resulted in this error.
> >
> > --------------------------------------------------------------------------
> --
> > --------------------------------------------------------------------------
> --
> > -------------
> >
> > struct sockaddr_in local;
> >
> > local.sin_family = AF_INET;
> > local.sin_len = sizeof(local);
> > local.sin_port = htons(7734);
> > local.sin_addr.s_addr = inet_addr("172.16.6.10"); //bp->bp_siaddr;
> > if(bind(s, (struct sockaddr *) &local, sizeof(local)) < 0) {
> > printf("bind error");
> > }
> >
> > --------------------------------------------------------------------------
> --
> > --------------------------------------------------------------------------
> --
> > -------------
> > Then I replaced "inet_addr("172.16.6.10")" with "INADDR_ANY" and I
> problem
> > never occured. I could then run my client-server application smoothly.
> > Question is why was I getting this error in the first case?
Have you stepped through the bind call. You have the sources, use
them. Find out why it says the address is not available.
> >
> > 3.0 Now I wanted to run the client application on the board and server on
> my
> > linux host. But the "connect" system fails when connecting to linux
> machine
> > saying "No route to host".
No route to host either means there is not route to the host!, or the
host is not replying to ARP requests. Run tcpdump/etherreal etc and
see if there are any packets coming out of the device. Check your
default route makes sense.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss