[ECOS] Assertion in BSD Stack - ARP

Jay Foster jay.foster@systech.com
Mon Aug 18 16:54:00 GMT 2003


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.

Jay

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



More information about the Ecos-discuss mailing list