aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154/6lowpan.c
diff options
context:
space:
mode:
authorTony Cheneau <tony.cheneau@amnesiak.org>2013-03-25 13:59:30 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-26 12:37:58 -0400
commitc7d0ab28b4c51de50c1fded2502e47a37771b6c3 (patch)
tree5692948542fca5bb1b5f490e0932c996afc7d5bd /net/ieee802154/6lowpan.c
parent0483546a3de329cad7705d42962edb09a28794c6 (diff)
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: Tony Cheneau <tony.cheneau@amnesiak.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee802154/6lowpan.c')
-rw-r--r--net/ieee802154/6lowpan.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index f9524513847a..d1d4ee69da27 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -573,6 +573,7 @@ static int lowpan_header_create(struct sk_buff *skb,
573 */ 573 */
574 { 574 {
575 mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA; 575 mac_cb(skb)->flags = IEEE802154_FC_TYPE_DATA;
576 mac_cb(skb)->seq = ieee802154_mlme_ops(dev)->get_dsn(dev);
576 577
577 /* prepare wpan address data */ 578 /* prepare wpan address data */
578 sa.addr_type = IEEE802154_ADDR_LONG; 579 sa.addr_type = IEEE802154_ADDR_LONG;
@@ -1127,6 +1128,12 @@ static u16 lowpan_get_short_addr(const struct net_device *dev)
1127 return ieee802154_mlme_ops(real_dev)->get_short_addr(real_dev); 1128 return ieee802154_mlme_ops(real_dev)->get_short_addr(real_dev);
1128} 1129}
1129 1130
1131static u8 lowpan_get_dsn(const struct net_device *dev)
1132{
1133 struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
1134 return ieee802154_mlme_ops(real_dev)->get_dsn(real_dev);
1135}
1136
1130static struct header_ops lowpan_header_ops = { 1137static struct header_ops lowpan_header_ops = {
1131 .create = lowpan_header_create, 1138 .create = lowpan_header_create,
1132}; 1139};
@@ -1140,6 +1147,7 @@ static struct ieee802154_mlme_ops lowpan_mlme = {
1140 .get_pan_id = lowpan_get_pan_id, 1147 .get_pan_id = lowpan_get_pan_id,
1141 .get_phy = lowpan_get_phy, 1148 .get_phy = lowpan_get_phy,
1142 .get_short_addr = lowpan_get_short_addr, 1149 .get_short_addr = lowpan_get_short_addr,
1150 .get_dsn = lowpan_get_dsn,
1143}; 1151};
1144 1152
1145static void lowpan_setup(struct net_device *dev) 1153static void lowpan_setup(struct net_device *dev)