Commit c7d0ab28 authored by Tony Cheneau's avatar Tony Cheneau Committed by David S. Miller

6lowpan: obtain IEEE802.15.4 sequence number from the MAC layer

Sets the sequence number in the frame format. Without this fix, the sequence
number is always set to 0. This makes trafic analysis very hard.
Signed-off-by: default avatarTony Cheneau <tony.cheneau@amnesiak.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0483546a
...@@ -573,6 +573,7 @@ static int lowpan_header_create(struct sk_buff *skb, ...@@ -573,6 +573,7 @@ static int lowpan_header_create(struct sk_buff *skb,
*/ */
{ {
mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA; mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA;
mac_cb(skb)->seq = ieee802154_mlme_ops(dev)->get_dsn(dev);
/* prepare wpan address data */ /* prepare wpan address data */
sa.addr_type = IEEE802154_ADDR_LONG; sa.addr_type = IEEE802154_ADDR_LONG;
...@@ -1127,6 +1128,12 @@ static u16 lowpan_get_short_addr(const struct net_device *dev) ...@@ -1127,6 +1128,12 @@ static u16 lowpan_get_short_addr(const struct net_device *dev)
return ieee802154_mlme_ops(real_dev)->get_short_addr(real_dev); return ieee802154_mlme_ops(real_dev)->get_short_addr(real_dev);
} }
static u8 lowpan_get_dsn(const struct net_device *dev)
{
struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
return ieee802154_mlme_ops(real_dev)->get_dsn(real_dev);
}
static struct header_ops lowpan_header_ops = { static struct header_ops lowpan_header_ops = {
.create = lowpan_header_create, .create = lowpan_header_create,
}; };
...@@ -1140,6 +1147,7 @@ static struct ieee802154_mlme_ops lowpan_mlme = { ...@@ -1140,6 +1147,7 @@ static struct ieee802154_mlme_ops lowpan_mlme = {
.get_pan_id = lowpan_get_pan_id, .get_pan_id = lowpan_get_pan_id,
.get_phy = lowpan_get_phy, .get_phy = lowpan_get_phy,
.get_short_addr = lowpan_get_short_addr, .get_short_addr = lowpan_get_short_addr,
.get_dsn = lowpan_get_dsn,
}; };
static void lowpan_setup(struct net_device *dev) static void lowpan_setup(struct net_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment