Bug 1000046, BSD TCPIP asserts with "unregistered netisr handler" for ARP packets

Jonathan Larmour jifl@jifvik.org
Wed Jul 19 14:27:00 GMT 2006


Philip Keller wrote:
> I propose the following patch to fix bug 1000046, "BSD TCPIP asserts with
> 'unregistered netisr handler' for ARP packets." It simply does what Gary
> Thomas suggested two years ago:
> 
> * src/ecos/support.c: In cyg_netint, don't handle events that don't have
> handlers registered. Fixes Bug 1000046, whereby an assertion or crash
> resulted from an ARP package arriving before network initialization was
> complete.

I was wondering what happens to the packet in question though. From a quick 
glance it will get queued, and only be processed when another arp packet 
comes in. If too many ARP packets come in, the queue could eventually fill 
before the netisr handler is able to run. I was wondering if that happened 
would the whole stack jam? But it seems that we're in luck because the 
NETISR_ARP handler is invoked always, not only when something is enqueued.

So I think this patch is ok, so I've applied it thanks.

Jifl

> diff --context --ignore-all-space --recursive
> cvs_08_02_06/ecos-2.0.x/packages/net/bsd_tcpip/current/src/ecos/support.c
> ecos-2.0.x/packages/net/bsd_tcpip/current/src/ecos/support.c
> ***
> cvs_08_02_06/ecos-2.0.x/packages/net/bsd_tcpip/current/src/ecos/support.c
> Wed Feb  8 11:04:58 2006
> --- ecos-2.0.x/packages/net/bsd_tcpip/current/src/ecos/support.c	Wed
> Jul 19 14:27:29 2006
> ***************
> *** 729,735 ****
>           spl = splsoftnet(); // Prevent any overlapping "stack" processing
>           for (lvl = NETISR_MIN;  lvl <= NETISR_MAX;  lvl++) {
>               if (curisr & (1<<lvl)) {
> !                 CYG_ASSERT(_netisr_handlers[lvl] != 0, "unregistered
> netisr handler");
>                   (*_netisr_handlers[lvl])();
>               }
>           }
> --- 729,735 ----
>           spl = splsoftnet(); // Prevent any overlapping "stack" processing
>           for (lvl = NETISR_MIN;  lvl <= NETISR_MAX;  lvl++) {
>               if (curisr & (1<<lvl)) {
> !             	if (_netisr_handlers[lvl] != 0)
>   	                (*_netisr_handlers[lvl])();
>               }
>           }
> 
> 


-- 
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine



More information about the Ecos-patches mailing list