From 515fb5a3fd495cd0a2b9dcc479fc9b61411f8e5d Mon Sep 17 00:00:00 2001 From: likewise Date: Tue, 17 Aug 2004 08:39:43 +0000 Subject: [PATCH] First packet on queue generated assertion failure. Reported by David Haas on lwip-users on Friday 13th. --- src/netif/etharp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/netif/etharp.c b/src/netif/etharp.c index 40d84b3d..a3fbbf2a 100644 --- a/src/netif/etharp.c +++ b/src/netif/etharp.c @@ -752,8 +752,14 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q) p = pbuf_take(q); /* packet could be taken over? */ if (p != NULL) { - /* queue packet */ - pbuf_queue(arp_table[i].p, p); + /* queue packet ... */ + if (arp_table[i].p == NULL) { + /* ... in the empty queue */ + arp_table[i].p = p; + } else { + /* ... at tail of non-empty queue */ + pbuf_queue(arp_table[i].p, p); + } LWIP_DEBUGF(ETHARP_DEBUG | DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %d\n", (void *)q, i)); result = ERR_OK; } else {