mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
ng_ipv6: fix behavior for multicast over multiple interfaces
This commit is contained in:
parent
b2efe73f87
commit
ba75602f14
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user