diff options
author | David S. Miller <davem@davemloft.net> | 2014-03-03 04:20:45 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-03 04:20:45 +0400 |
commit | 80cbfd3695c68d4dd9c41a0342837cb116958ea5 (patch) | |
tree | b70506fc095825b4ae6eb602c773c7405e18229e | |
parent | 1bc693e18a0b279a8b1d174485750601f3f44d7b (diff) | |
parent | b6f82fc05da4d21d03e6171202d8cf181f4da053 (diff) | |
download | linux-80cbfd3695c68d4dd9c41a0342837cb116958ea5.tar.xz |
Merge branch '6lowpan'
Alexander Aring says:
====================
6lowpan: fix issues with byte ordering types
I got some mail from a "kbuild test robot" and it detected some byte
ordering issues with the tag and datagram size value of 6LoWPAN IEEE
802.15.4 fragmentation header.
This patch series should fix the issues with the byte ordering.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ieee802154/6lowpan_rtnl.c | 4 | ||||
-rw-r--r-- | net/ieee802154/reassembly.c | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c index c7bd8b55f7ce..e4726180fc36 100644 --- a/net/ieee802154/6lowpan_rtnl.c +++ b/net/ieee802154/6lowpan_rtnl.c @@ -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 @@ -519,7 +518,6 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev, } lowpan_dev_info(dev)->real_dev = real_dev; - lowpan_dev_info(dev)->fragment_tag = 0; mutex_init(&lowpan_dev_info(dev)->dev_list_mtx); entry = kzalloc(sizeof(*entry), GFP_KERNEL); diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c index eb5995e74316..4511fc22ef16 100644 --- a/net/ieee802154/reassembly.c +++ b/net/ieee802154/reassembly.c @@ -35,7 +35,7 @@ static struct inet_frags lowpan_frags; static int lowpan_frag_reasm(struct lowpan_frag_queue *fq, struct sk_buff *prev, struct net_device *dev); -static unsigned int lowpan_hash_frag(__be16 tag, __be16 d_size, +static unsigned int lowpan_hash_frag(__be16 tag, u16 d_size, const struct ieee802154_addr *saddr, const struct ieee802154_addr *daddr) { |