Skip to content

Commit

Permalink
Update datalink hdr in frame grow and deepcopy
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensmiers committed Jun 19, 2015
1 parent ea9cb64 commit 4578069
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stack/pico_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ int pico_frame_grow(struct pico_frame *f, uint32_t size)
/* Update hdr fields to new buffer*/
addr_diff = (int)(f->buffer - oldbuf);
f->net_hdr += addr_diff;
f->datalink_hdr += addr_diff;
f->transport_hdr += addr_diff;
f->app_hdr += addr_diff;
f->start += addr_diff;
Expand Down Expand Up @@ -213,6 +214,7 @@ struct pico_frame *pico_frame_deepcopy(struct pico_frame *f)

/* Update in-buffer pointers with offset */
addr_diff = (int)(new->buffer - f->buffer);
new->datalink_hdr += addr_diff;
new->net_hdr += addr_diff;
new->transport_hdr += addr_diff;
new->app_hdr += addr_diff;
Expand Down

0 comments on commit 4578069

Please sign in to comment.