1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #3179 from cgundogan/ng_icmpv6_release

ng_icmpv6: fix release of pkt
This commit is contained in:
Martine Lenders 2015-06-11 15:01:23 +02:00
commit 8f0f6708f5
2 changed files with 5 additions and 3 deletions

View File

@ -135,7 +135,7 @@ void ng_icmpv6_demux(kernel_pid_t iface, ng_pktsnip_t *pkt)
}
/* ICMPv6 is not interested anymore so `- 1` */
ng_pktbuf_hold(pkt, ng_netreg_num(NG_NETTYPE_ICMPV6, hdr->type) - 1);
ng_pktbuf_hold(pkt, ng_netreg_num(NG_NETTYPE_ICMPV6, hdr->type));
while (sendto != NULL) {
ng_netapi_receive(sendto->pid, pkt);

View File

@ -178,8 +178,10 @@ int _icmpv6_ping(int argc, char **argv)
case NG_NETAPI_MSG_TYPE_RCV:
vtimer_now(&stop);
stop = timex_sub(stop, start);
success += _handle_reply((ng_pktsnip_t *)msg.content.ptr,
timex_uint64(stop));
ng_pktsnip_t *pkt = (ng_pktsnip_t *)msg.content.ptr;
success += _handle_reply(pkt, timex_uint64(stop));
ng_pktbuf_release(pkt);
if (timex_cmp(stop, max_rtt) > 0) {
max_rtt = stop;