This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Can't get socket's IP address w/ new stack?
On Mon, 2003-08-18 at 13:09, Grant Edwards wrote:
> On Mon, Aug 18, 2003 at 10:56:35AM -0500, Grant Edwards wrote:
>
> > I think the problem is in the sequence of ioctl() calls I'm
> > using to configure the stack. The SIOCSxxxxx ioctl() seem to
> > have odd side-effects, and you have to do them in a certain
> > sequence (and do some of them more than once?). The magic
> > sequence must have changed.
>
> Here's the answer:
>
> With the new stack you have to:
>
> 1) Set the address (SIOCIFADDR)
> 2) Set the mask (SIOCSIFNETMASK)
> ++> 3) Set the address _again_ (SIOCSIFADDR) <++
> 4) Set the broadcast address (SIOCSIFBRDADDR)
> 5) Set the routing (SIOCADDRT)
>
> With the old stack, you didn't have to do step 3 (set the IP
> address a second time). Odd, eh?
>
What happens if you skip step 1 (i.e. only do SIFNETMASK followed
by SIFADDR)?
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss