diff --git a/proj/minimal/lwipopts.h b/proj/minimal/lwipopts.h index 85e304de..da3dac22 100644 --- a/proj/minimal/lwipopts.h +++ b/proj/minimal/lwipopts.h @@ -120,6 +120,7 @@ a lot of data that needs to be copied, this should be set high. */ /* ---------- ARP options ---------- */ #define ARP_TABLE_SIZE 10 +#define ARP_QUEUEING 0 /* ---------- IP options ---------- */ /* Define IP_FORWARD to 1 if you wish to have the ability to forward diff --git a/proj/unixlib/lwipopts.h b/proj/unixlib/lwipopts.h index fcc19448..9cefb949 100644 --- a/proj/unixlib/lwipopts.h +++ b/proj/unixlib/lwipopts.h @@ -123,6 +123,7 @@ a lot of data that needs to be copied, this should be set high. */ /* ---------- ARP options ---------- */ #define ARP_TABLE_SIZE 10 +#define ARP_QUEUEING 1 /* ---------- IP options ---------- */ /* Define IP_FORWARD to 1 if you wish to have the ability to forward diff --git a/proj/unixsim/lwipopts.h b/proj/unixsim/lwipopts.h index fcc19448..41d152b1 100644 --- a/proj/unixsim/lwipopts.h +++ b/proj/unixsim/lwipopts.h @@ -123,6 +123,8 @@ a lot of data that needs to be copied, this should be set high. */ /* ---------- ARP options ---------- */ #define ARP_TABLE_SIZE 10 +#define ARP_QUEUEING 1 + /* ---------- IP options ---------- */ /* Define IP_FORWARD to 1 if you wish to have the ability to forward diff --git a/src/netif/etharp.c b/src/netif/etharp.c index a29c379b..175a18ba 100644 --- a/src/netif/etharp.c +++ b/src/netif/etharp.c @@ -3,6 +3,9 @@ * Address Resolution Protocol module for IP over Ethernet * * $Log: etharp.c,v $ + * Revision 1.11 2002/11/18 10:31:05 likewise + * Conditionally have ARP queue outgoing pbufs. + * * Revision 1.10 2002/11/18 08:41:31 jani * Move etharp packed structures to the header file. * @@ -682,13 +685,19 @@ struct pbuf *etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pb ip_addr_set(&arp_table[i].ipaddr, ipaddr); arp_table[i].ctime = ctime; arp_table[i].state = ETHARP_STATE_PENDING; - /* remember pbuf to queue, if any */ - arp_table[i].p = q; +#if ARP_QUEUEING /* any pbuf to queue? */ if (q != NULL) { + /* copy PBUF_REF referenced payloads to PBUF_RAM */ + q = pbuf_unref(q); /* pbufs are queued, increase the reference count */ pbuf_ref_chain(q); } + /* remember pbuf to queue, if any */ + arp_table[i].p = q; +#else + arp_table[i].p = NULL; +#endif } /* could not allocate pbuf for ARP request */ else {