aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ieee802154/6lowpan.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 3b9d5f20bd1c..92429db0b237 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -223,10 +223,6 @@ lowpan_uncompress_addr(struct sk_buff *skb, struct in6_addr *ipaddr,
223 if (prefcount > 0) 223 if (prefcount > 0)
224 memcpy(ipaddr, prefix, prefcount); 224 memcpy(ipaddr, prefix, prefcount);
225 225
226 if (prefcount + postcount < 16)
227 memset(&ipaddr->s6_addr[prefcount], 0,
228 16 - (prefcount + postcount));
229
230 if (postcount > 0) { 226 if (postcount > 0) {
231 memcpy(&ipaddr->s6_addr[16 - postcount], skb->data, postcount); 227 memcpy(&ipaddr->s6_addr[16 - postcount], skb->data, postcount);
232 skb_pull(skb, postcount); 228 skb_pull(skb, postcount);
@@ -723,7 +719,7 @@ frame_err:
723static int 719static int
724lowpan_process_data(struct sk_buff *skb) 720lowpan_process_data(struct sk_buff *skb)
725{ 721{
726 struct ipv6hdr hdr; 722 struct ipv6hdr hdr = {};
727 u8 tmp, iphc0, iphc1, num_context = 0; 723 u8 tmp, iphc0, iphc1, num_context = 0;
728 u8 *_saddr, *_daddr; 724 u8 *_saddr, *_daddr;
729 int err; 725 int err;
@@ -868,8 +864,6 @@ lowpan_process_data(struct sk_buff *skb)
868 864
869 hdr.priority = ((tmp >> 2) & 0x0f); 865 hdr.priority = ((tmp >> 2) & 0x0f);
870 hdr.flow_lbl[0] = ((tmp << 6) & 0xC0) | ((tmp >> 2) & 0x30); 866 hdr.flow_lbl[0] = ((tmp << 6) & 0xC0) | ((tmp >> 2) & 0x30);
871 hdr.flow_lbl[1] = 0;
872 hdr.flow_lbl[2] = 0;
873 break; 867 break;
874 /* 868 /*
875 * Flow Label carried in-line 869 * Flow Label carried in-line
@@ -885,10 +879,6 @@ lowpan_process_data(struct sk_buff *skb)
885 break; 879 break;
886 /* Traffic Class and Flow Label are elided */ 880 /* Traffic Class and Flow Label are elided */
887 case 3: /* 11b */ 881 case 3: /* 11b */
888 hdr.priority = 0;
889 hdr.flow_lbl[0] = 0;
890 hdr.flow_lbl[1] = 0;
891 hdr.flow_lbl[2] = 0;
892 break; 882 break;
893 default: 883 default:
894 break; 884 break;