]> git.karo-electronics.de Git - linux-beck.git/commitdiff
6lowpan: iphc: fix stateful multicast compression
authorAlexander Aring <aar@pengutronix.de>
Wed, 24 Feb 2016 11:01:03 +0000 (12:01 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 24 Feb 2016 15:14:30 +0000 (16:14 +0100)
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 <aar@pengutronix.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/6lowpan/iphc.c

index d2a565cde4f4b96ed530700a1dc4d5ea9cece8a2..8dd8388c8eba18b88a8e1a0ef816efc4de01a8f2 100644 (file)
@@ -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);
                }