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: Assertion in BSD Stack - ARP


On Mon, 2003-08-18 at 10:40, Jay Foster wrote:
> I have discovered a problem with the eCos BSD network stack.  I would get
> the assertion, "unregistered netisr handler" from file
> packages/net/bsd_tcpip/current/src/ecos/support.c.
> 
> The problem turns out to be a race condition where ARP messages are
> routed from the ethernet interface to the stack before a network "ISR"
> handler
> is registered for it (via register_netisr()).
> 
> In my configuration, there are 3 handlers registered: NETISR_IP,
> NETISR_IPV6,
> and NETISR_ARP).  The first two are registered from the
> cyg_hal_invoke_constructors(),
> before the network "ISR" thread runs.  The NETISR_ARP handler is not
> registered
> until much later.  It seems to get registered on the first SIOCSIFADDR
> ioctl(),
> which is typically made from the init_net() function, usually called from 
> init_all_network_interfaces().  The call traceback is:
> 
> 	init_net()->ioctl(SIOCSIFADDR)->ifioctl()->in_control()->
> 	in_ifioctl()->rtinit()->arp_rtrequest()->register_netisr().
> 
> If an ARP packet arrives on the interface before this time, it will cause
> the assertion.  It seems like the NETISR_ARP handler should be registered
> before the network "ISR" thread runs, so this cannot happen.  Perhaps from
> some constructor.  I am posting this with the idea that one of the
> eCos network gurus would have a good idea on how to close this hole, as I
> am not that familiar with the network and it's initialization.
> 

We need to look at this, although it may make sense to just make the
ISR dispatcher smarter (don't handle events that don't have handlers
registered).

Please file this with our bug database:
  http://bugs.ecos.sourceware.org/

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


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