diff --git a/sys/net/network_layer/ng_ipv6/ng_ipv6.c b/sys/net/network_layer/ng_ipv6/ng_ipv6.c index 7f2be0feac945eac0d56d1457f06bff61ccfbe94..f53090e4729a721e52f8b162249e50ba849aa34b 100644 --- a/sys/net/network_layer/ng_ipv6/ng_ipv6.c +++ b/sys/net/network_layer/ng_ipv6/ng_ipv6.c @@ -308,7 +308,8 @@ static int _fill_ipv6_hdr(kernel_pid_t iface, ng_pktsnip_t *ipv6, /* We deal with multiple interfaces here (multicast) => possible * different source addresses => duplication of payload needed */ - while (ptr != payload) { + while (ptr != payload->next) { + ng_pktsnip_t *old = ptr->next; /* duplicate everything including payload */ ptr->next = ng_pktbuf_start_write(ptr->next); @@ -317,7 +318,7 @@ static int _fill_ipv6_hdr(kernel_pid_t iface, ng_pktsnip_t *ipv6, return -ENOBUFS; } - ptr = ptr->next; + ptr = old; } } #endif /* NG_NETIF_NUMOF */ @@ -348,6 +349,7 @@ static void _send_multicast(kernel_pid_t iface, ng_pktsnip_t *pkt, { ng_pktsnip_t *netif; kernel_pid_t ifs[NG_NETIF_NUMOF]; + size_t ifnum = 0; if (iface == KERNEL_PID_UNDEF) { /* get list of interfaces */ @@ -400,7 +402,7 @@ static void _send_multicast(kernel_pid_t iface, ng_pktsnip_t *pkt, LL_PREPEND(pkt, netif); - _send_multicast_over_iface(iface, pkt, netif); + _send_multicast_over_iface(ifs[i], pkt, netif); } } else { @@ -418,6 +420,7 @@ static void _send_multicast(kernel_pid_t iface, ng_pktsnip_t *pkt, _send_multicast_over_iface(iface, pkt, netif); } #else /* NG_NETIF_NUMOF */ + (void)ifnum; /* not used in this build branch */ if (iface == KERNEL_PID_UNDEF) { iface = ifs[0];