Further update to ARP queueing: Changed pbuf_copy() implementation so that it can be reused (don't allocate the target pbuf inside pbuf_copy()).

This commit is contained in:
goldsimon
2007-05-04 21:31:25 +00:00
parent be316e81a7
commit 79d9b36ece
4 changed files with 67 additions and 24 deletions

View File

@@ -864,7 +864,11 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q)
}
if(copy_needed) {
/* copy the whole packet into new pbufs */
p = pbuf_copy(q);
p = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
if (pbuf_copy(p, q) != ERR_OK) {
pbuf_free(p);
p = NULL;
}
} else {
/* referencing the old pbuf is enough */
p = q;