lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Question about "Fix regression in etharp.c: Allocate co


From: Dirk Ziegelmeier
Subject: Re: [lwip-devel] Question about "Fix regression in etharp.c: Allocate correct pbuf layer"
Date: Wed, 24 Aug 2016 09:22:33 +0200

it was a regession of "Work on bug #48824: ethernet.c extensions: Implement ethernet_output()", not lwip 1.4.1

http://git.savannah.gnu.org/cgit/lwip.git/commit/?id=18136c047bc36934c868af9b779bffa217014cd0

Ciao
Dirk

--
Dirk Ziegelmeier * address@hidden * http://www.ziegelmeier.net

On Wed, Aug 24, 2016 at 9:20 AM, Axel Lin <address@hidden> wrote:
Hi Dirk,
I found below commit:
commit 4456c7d230d91ac60401db02e15178fe0636007d
Author: Dirk Ziegelmeier <address@hidden>
Date:   Tue Aug 23 12:32:57 2016 +0200

    Fix regression in etharp.c: Allocate correct pbuf layer

diff --git a/src/core/ipv4/etharp.c b/src/core/ipv4/etharp.c
index 5288b74..42485d1 100644
--- a/src/core/ipv4/etharp.c
+++ b/src/core/ipv4/etharp.c
@@ -1097,7 +1097,7 @@ etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q)
     }
     if (copy_needed) {
       /* copy the whole packet into new pbufs */
-      p = pbuf_alloc(PBUF_RAW_TX, p->tot_len, PBUF_RAM);
+      p = pbuf_alloc(PBUF_LINK, p->tot_len, PBUF_RAM);
       if (p != NULL) {
         if (pbuf_copy(p, q) != ERR_OK) {
           pbuf_free(p);

Since the commit log says it's a regression, may I know which commit cause
the problem and what is the user visible impact of the issue.

In
commit 979bee386c60fbd5f74a5e7bb3e2e25af35ef46e
Author: Dirk Ziegelmeier <address@hidden>
Date:   Tue Aug 23 16:58:17 2016 +0200

    Work on bug #48868: Cleanup etharp.c not to use struct eth_hdr: Cleanup etharp_raw() to use ethernet_output()

There is below change, it's not clear to me if this is a fix or a clean up.
   /* allocate a pbuf for the outgoing ARP request packet */
-  p = pbuf_alloc(PBUF_RAW_TX, SIZEOF_ETHARP_PACKET_TX, PBUF_RAM);
+  p = pbuf_alloc(PBUF_LINK, SIZEOF_ETHARP_PACKET_TX, PBUF_RAM);

I asked above questions because I have project still using lwip-1.4.1 which has below codes (I'm not sure if I need to update my code in lwip-1.4.1 as well.):

In etharp_query():
      /* copy the whole packet into new pbufs */
      p = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);

and ...
in etharp_raw():
  /* allocate a pbuf for the outgoing ARP request packet */
  p = pbuf_alloc(PBUF_RAW, SIZEOF_ETHARP_PACKET, PBUF_RAM);


Regards,
Axel



reply via email to

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