Make patch 4 of David's Minix3 patches superfluous: Use PBUF_POOL to duplicate incoming packets in UDP

... which would have been the correct way to do it anyway :-)
http://git.minix3.org/index.cgi?p=minix.git;a=blob;f=minix/lib/liblwip/patches/0004-MINIX-3-only-avoid-large-contiguous-allocations.patch;h=f23143c7e8d372b3b35b599a97975d79924f73c1;hb=HEAD
This commit is contained in:
Dirk Ziegelmeier 2017-05-03 09:02:35 +02:00
parent 7defe372b9
commit d32492e953

View File

@ -374,10 +374,8 @@ udp_input(struct pbuf *p, struct netif *inp)
pbuf_header_force(p, hdrs_len);
p_header_changed = 1;
}
q = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
q = pbuf_clone(PBUF_RAW, PBUF_POOL, p);
if (q != NULL) {
err_t err = pbuf_copy(q, p);
if (err == ERR_OK) {
/* move payload to UDP data */
pbuf_header(q, -hdrs_len);
mpcb->recv(mpcb->recv_arg, mpcb, q, ip_current_src_addr(), src);
@ -386,7 +384,6 @@ udp_input(struct pbuf *p, struct netif *inp)
}
}
}
}
if (p_header_changed) {
/* and move payload to UDP data again */
pbuf_header(p, -hdrs_len);