]> Pileus Git - ~andy/linux/blobdiff - net/ieee802154/6lowpan_iphc.c
6lowpan: add udp warning for elided checksum
[~andy/linux] / net / ieee802154 / 6lowpan_iphc.c
index 02bf74d80e72e0de19c21d642a28304ec42d350d..a70fa66b5357ab930c1bb87daca4df317ab51ad6 100644 (file)
@@ -309,9 +309,14 @@ uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
                pr_debug("uncompressed UDP ports: src = %d, dst = %d\n",
                         ntohs(uh->source), ntohs(uh->dest));
 
-               /* copy checksum */
-               memcpy(&uh->check, &skb->data[0], 2);
-               skb_pull(skb, 2);
+               /* checksum */
+               if (tmp & LOWPAN_NHC_UDP_CS_C) {
+                       pr_debug_ratelimited("checksum elided currently not supported\n");
+                       goto err;
+               } else {
+                       memcpy(&uh->check, &skb->data[0], 2);
+                       skb_pull(skb, 2);
+               }
 
                /*
                 * UDP lenght needs to be infered from the lower layers