lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] netif/etharp assertion failure


From: Robin Iddon
Subject: [lwip-users] netif/etharp assertion failure
Date: Fri, 29 Jun 2007 14:15:08 +0100
User-agent: Thunderbird 2.0.0.4 (X11/20070620)

Hi,

I am getting an assertion failure (after extended use) in etharp.c

LWIP assertion failure, file: netif/etharp.c, line: 886
no packet queues allowed!

Looking at the code:

     p = q;
     while (p) {
LWIP_ASSERT("no packet queues allowed!", (p->len == p->tot_len) || (p->next == 0));
       if(p->flags != PBUF_FLAG_ROM) {
         copy_needed = 1;
         break;
       }
       p = p->next;
     }

I think the intent is to ensure that only single packets are queued up on ARP entries, not queues of packets.

To me the code says that q must point to a pbuf that has just one element (p->len == p->tot_len case). If there were two pbufs in a chain, the first pbuf would fail both conditions (p->len would presumably be less than p->tot_len and p->next wouldn't be NULL).

I think the code should have said:

     p = q;
     while (p) {
LWIP_ASSERT("no packet queues allowed!", (p->tot_len == (p->len + (p->next ? p->next->tot_len:0) );
       if(p->flags != PBUF_FLAG_ROM) {
         copy_needed = 1;
         break;
       }
       p = p->next;
     }

Or am I missing something?

Cheers,
Robin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]