Skip to content

Commit

Permalink
gnrc_sixlowpan: Forward multicast packets even if they are registerd …
Browse files Browse the repository at this point in the history
…with the receiving netif
  • Loading branch information
DipSwitch committed Mar 24, 2016
1 parent 66c011d commit be18502
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,12 @@ static inline bool _pkt_not_for_me(kernel_pid_t *iface, ipv6_hdr_t *hdr)
}
}

static inline bool _pkt_none_local_mcast(ipv6_hdr_t *hdr)
{
return (hdr->dst->u8[0] == 0xff) &&
((hdr->dst->u8[1] & 0x0f) > IPV6_ADDR_MCAST_SCP_LINK_LOCAL);
}

static void _dispatch_rcv_pkt(gnrc_nettype_t type, uint32_t demux_ctx,
gnrc_pktsnip_t *pkt)
{
Expand Down Expand Up @@ -852,8 +858,17 @@ static void _receive(gnrc_pktsnip_t *pkt)
ipv6_addr_to_str(addr_str, &(hdr->dst), sizeof(addr_str)),
hdr->nh, byteorder_ntohs(hdr->len));

if (_pkt_not_for_me(&iface, hdr)) { /* if packet is not for me */
DEBUG("ipv6: packet destination not this host\n");
/* if packet is not for me, or its a higher than link-local multicast */
if (_pkt_not_for_me(&iface, hdr)
|| _pkt_none_local_mcast(hdr)) {
#if ENABLE_DEBUG
if (_pkt_not_for_me(&iface, hdr)) {
DEBUG("ipv6: packet destination not this host\n");
}
else {
DEBUG("ipv6: packet destination is multicast\n");
}
#endif

#ifdef MODULE_GNRC_IPV6_ROUTER /* only routers redirect */
/* redirect to next hop */
Expand Down

0 comments on commit be18502

Please sign in to comment.