This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: ioctl (SIOCADDRT) never returns
- To: <ecos-discuss at sources dot redhat dot com>
- Subject: Re: [ECOS] ioctl (SIOCADDRT) never returns
- From: Hugo Tyson <hmt at redhat dot com>
- Date: 17 Oct 2001 16:50:32 +0100
- References: <000001c1571f$bb94fa30$090110ac@TRENT>
"Trenton D. Adams" <tadams@extremeeng.com> writes:
> The following call in bring_half_up () of
> "net/tcpip/current/src/lib/dhcp_prot.c" is called, but never returns.
> What is SIOCADDRT exactly? It doesn't lock my program because I still
> receive ticker and RX interrupts from my card. I don't know why there
> are RX interrupts yet, but I'm going to try and find out. I need to get
> a windows packet sniffer in order to be able to find out if the RX
> interrupts are occuring because of a DHCP packet or something. I don't
> think that's possible at this stage in the startup sequence though!?
>
> if (ioctl(s, SIOCADDRT, &route)) { /* add route */
That mnemonic always confuses me too, 'cos you can't help parse it as ADDR
for address and T for ??? but it's actually as in the comment: ADD RouTe !
I think it's adding a default global route so you can send packets to a
half-up interface, IIRC. Ie. a route so that the system knows to send
packets to that interface even without knowing IP addresses for the network
that's on there.
Are you sure that it never returns, rather than "that thread is immediately
preempted by a higher priority thread which then never yields", eg. trying
to run deliveries from your device? Just a thought.
- Huge