Fixed bug #20429: use the new pbuf_copy_partial instead of the old copy_from_pbuf, which illegally modified the given pbuf; Introduced pbuf_copy_partial, making netbuf_copy_partial use this function.

This commit is contained in:
goldsimon
2007-07-25 18:53:45 +00:00
parent 8be76ed450
commit f9c30017b0
6 changed files with 60 additions and 82 deletions

View File

@@ -149,9 +149,9 @@ err_t netbuf_data (struct netbuf *buf,
s8_t netbuf_next (struct netbuf *buf);
void netbuf_first (struct netbuf *buf);
void netbuf_copy_partial(struct netbuf *buf, void *dataptr,
u16_t len, u16_t offset);
#define netbuf_copy_partial(buf, dataptr, len, offset) \
pbuf_copy_partial((buf)->p, (dataptr), (len), (offset))
#define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0)
#define netbuf_len(buf) ((buf)->p->tot_len)
#define netbuf_fromaddr(buf) ((buf)->addr)

View File

@@ -111,6 +111,7 @@ void pbuf_cat(struct pbuf *h, struct pbuf *t);
void pbuf_chain(struct pbuf *h, struct pbuf *t);
struct pbuf *pbuf_dechain(struct pbuf *p);
err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from);
u16_t pbuf_copy_partial(struct pbuf *p, void *dataptr, u16_t len, u16_t offset);
#ifdef __cplusplus
}