Skip to content

Commit

Permalink
6lowpan: iphc: fix stateful multicast compression
Browse files Browse the repository at this point in the history
In case of multicast address we need to set always the LOWPAN_IPHC_M bit
and if a destination context identifier was found for a multicast
address then we need to set the LOWPAN_IPHC_DAC as well.

Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
Alexander Aring authored and holtmann committed Feb 24, 2016
1 parent ebba380 commit 8790404
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/6lowpan/iphc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,12 +1118,13 @@ int lowpan_header_compress(struct sk_buff *skb, const struct net_device *dev,
/* destination address compression */
if (ipv6_daddr_type & IPV6_ADDR_MULTICAST) {
pr_debug("destination address is multicast: ");
iphc1 |= LOWPAN_IPHC_M;
if (dci) {
iphc1 |= lowpan_iphc_mcast_ctx_addr_compress(&hc_ptr,
&dci_entry,
&hdr->daddr);
iphc1 |= LOWPAN_IPHC_DAC;
} else {
iphc1 |= LOWPAN_IPHC_M;
iphc1 |= lowpan_iphc_mcast_addr_compress(&hc_ptr,
&hdr->daddr);
}
Expand Down

0 comments on commit 8790404

Please sign in to comment.