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>
This commit is contained in:
David S. Miller 2014-03-02 19:20:45 -05:00
Родитель 1bc693e18a b6f82fc05d
Коммит 80cbfd3695
2 изменённых файлов: 2 добавлений и 4 удалений

Просмотреть файл

@ -265,8 +265,7 @@ lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev)
/* first fragment header */ /* first fragment header */
head[0] = LOWPAN_DISPATCH_FRAG1 | ((dgram_size >> 8) & 0x7); head[0] = LOWPAN_DISPATCH_FRAG1 | ((dgram_size >> 8) & 0x7);
head[1] = dgram_size & 0xff; head[1] = dgram_size & 0xff;
head[2] = tag >> 8; memcpy(head + 2, &tag, sizeof(tag));
head[3] = tag & 0xff;
/* calc the nearest payload length(divided to 8) for first fragment /* calc the nearest payload length(divided to 8) for first fragment
* which fits into a IEEE802154_MTU * 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)->real_dev = real_dev;
lowpan_dev_info(dev)->fragment_tag = 0;
mutex_init(&lowpan_dev_info(dev)->dev_list_mtx); mutex_init(&lowpan_dev_info(dev)->dev_list_mtx);
entry = kzalloc(sizeof(*entry), GFP_KERNEL); entry = kzalloc(sizeof(*entry), GFP_KERNEL);

Просмотреть файл

@ -35,7 +35,7 @@ static struct inet_frags lowpan_frags;
static int lowpan_frag_reasm(struct lowpan_frag_queue *fq, static int lowpan_frag_reasm(struct lowpan_frag_queue *fq,
struct sk_buff *prev, struct net_device *dev); 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 *saddr,
const struct ieee802154_addr *daddr) const struct ieee802154_addr *daddr)
{ {