6lowpan: use memcpy to set tag value in fraghdr
authorAlexander Aring <alex.aring@gmail.com>
Sun, 2 Mar 2014 07:09:35 +0000 (08:09 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Mar 2014 00:19:44 +0000 (19:19 -0500)
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ieee802154/6lowpan_rtnl.c

index 178ffb97816b03efc0e980d88420c9eabaa4460e..e4726180fc3635091fcf3c44e008e5d5d3c3021d 100644 (file)
@@ -265,8 +265,7 @@ lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev)
        /* first fragment header */
        head[0] = LOWPAN_DISPATCH_FRAG1 | ((dgram_size >> 8) & 0x7);
        head[1] = dgram_size & 0xff;
-       head[2] = tag >> 8;
-       head[3] = tag & 0xff;
+       memcpy(head + 2, &tag, sizeof(tag));
 
        /* calc the nearest payload length(divided to 8) for first fragment
         * which fits into a IEEE802154_MTU