This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can't get socket's IP address w/ new stack?


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?

-- 
Grant Edwards
grante@visi.com

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]