Skip to content

Commit

Permalink
Merge pull request contiki-os#1119 from cetic/pr-fix-6lowpan-frag-again
Browse files Browse the repository at this point in the history
Estimated fragments count should take into account 802.15.4 header size
  • Loading branch information
simonduq committed Sep 30, 2015
2 parents 0a648df + c5b563f commit 19a0fca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/net/ipv6/sicslowpan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ output(const uip_lladdr_t *localdest)
* IPv6/HC1/HC06/HC_UDP dispatchs/headers.
* The following fragments contain only the fragn dispatch.
*/
int estimated_fragments = ((int)uip_len) / ((int)MAC_MAX_PAYLOAD - SICSLOWPAN_FRAGN_HDR_LEN) + 1;
int estimated_fragments = ((int)uip_len) / (max_payload - SICSLOWPAN_FRAGN_HDR_LEN) + 1;
int freebuf = queuebuf_numfree() - 1;
PRINTFO("uip_len: %d, fragments: %d, free bufs: %d\n", uip_len, estimated_fragments, freebuf);
if(freebuf < estimated_fragments) {
Expand Down

0 comments on commit 19a0fca

Please sign in to comment.