Skip to content
Snippets Groups Projects
Commit 386d9f30 authored by Martine Lenders's avatar Martine Lenders
Browse files

Merge pull request #3516 from authmillenon/ng_sixlowpan/fix/fix-the-dereviewed-fixes

ng_sixlowpan: fix the kaputt-reviewed fixes
parents 60198e49 810654e1
No related branches found
No related tags found
No related merge requests found
...@@ -218,7 +218,7 @@ static void _send(ng_pktsnip_t *pkt) ...@@ -218,7 +218,7 @@ static void _send(ng_pktsnip_t *pkt)
ng_pktbuf_release(pkt2); ng_pktbuf_release(pkt2);
return; return;
} }
dispatch_len += 1; dispatch_len++;
} }
#else #else
/* suppress clang-analyzer report about iface being not read */ /* suppress clang-analyzer report about iface being not read */
...@@ -229,7 +229,7 @@ static void _send(ng_pktsnip_t *pkt) ...@@ -229,7 +229,7 @@ static void _send(ng_pktsnip_t *pkt)
ng_pktbuf_release(pkt2); ng_pktbuf_release(pkt2);
return; return;
} }
dispatch_len += 1; dispatch_len++;
#endif #endif
datagram_size = ng_pkt_len(pkt2->next); datagram_size = ng_pkt_len(pkt2->next);
...@@ -238,7 +238,7 @@ static void _send(ng_pktsnip_t *pkt) ...@@ -238,7 +238,7 @@ static void _send(ng_pktsnip_t *pkt)
/* IP should not send anything here if it is not a 6LoWPAN interface, /* IP should not send anything here if it is not a 6LoWPAN interface,
* so we don't need to check for NULL pointers */ * so we don't need to check for NULL pointers */
if ((datagram_size + dispatch_len) <= iface->max_frag_size) { if (datagram_size <= iface->max_frag_size) {
DEBUG("6lo: Send SND command for %p to %" PRIu16 "\n", DEBUG("6lo: Send SND command for %p to %" PRIu16 "\n",
(void *)pkt2, hdr->if_pid); (void *)pkt2, hdr->if_pid);
ng_netapi_send(hdr->if_pid, pkt2); ng_netapi_send(hdr->if_pid, pkt2);
...@@ -248,14 +248,14 @@ static void _send(ng_pktsnip_t *pkt) ...@@ -248,14 +248,14 @@ static void _send(ng_pktsnip_t *pkt)
#ifdef MODULE_NG_SIXLOWPAN_FRAG #ifdef MODULE_NG_SIXLOWPAN_FRAG
else { else {
DEBUG("6lo: Send fragmented (%u > %" PRIu16 ")\n", DEBUG("6lo: Send fragmented (%u > %" PRIu16 ")\n",
(unsigned int)datagram_size + dispatch_len, iface->max_frag_size); (unsigned int)datagram_size, iface->max_frag_size);
ng_sixlowpan_frag_send(hdr->if_pid, pkt2, datagram_size + dispatch_len, ng_sixlowpan_frag_send(hdr->if_pid, pkt2, datagram_size,
datagram_size); datagram_size - dispatch_len);
} }
#else #else
(void)datagram_size; (void)datagram_size;
DEBUG("6lo: packet too big (%u> %" PRIu16 ")\n", DEBUG("6lo: packet too big (%u> %" PRIu16 ")\n",
(unsigned int)(datagram_size + dispatch_len), iface->max_frag_size); (unsigned int)datagram_size, iface->max_frag_size);
#endif #endif
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment