aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-11-09 02:36:58 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-11-09 13:50:29 -0500
commit87023e1058c9ead2314c27761991816b48f949ef (patch)
tree0513166fcb65ae3c2a72f80e6b61f5b446b1ce22 /net/ieee802154
parent7bea1ea7b4c16af7c9263648e10f7edc88e5fc21 (diff)
ieee802154: fix iface dump with lowpan
This patch adds a hacked solution for an interface dump with a running lowpan interface. This will crash because lowpan and wpan interface use the same arphdr. To change the arphdr will change the UAPI, this patch checks on mtu which should on lowpan interface always different than IEEE802154_MTU. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/nl-mac.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c
index 50e9863823a5..fe77f0c770b8 100644
--- a/net/ieee802154/nl-mac.c
+++ b/net/ieee802154/nl-mac.c
@@ -166,7 +166,10 @@ static struct net_device *ieee802154_nl_get_dev(struct genl_info *info)
166 if (!dev) 166 if (!dev)
167 return NULL; 167 return NULL;
168 168
169 if (dev->type != ARPHRD_IEEE802154) { 169 /* Check on mtu is currently a hacked solution because lowpan
170 * and wpan have the same ARPHRD type.
171 */
172 if (dev->type != ARPHRD_IEEE802154 || dev->mtu != IEEE802154_MTU) {
170 dev_put(dev); 173 dev_put(dev);
171 return NULL; 174 return NULL;
172 } 175 }
@@ -448,7 +451,11 @@ int ieee802154_dump_iface(struct sk_buff *skb, struct netlink_callback *cb)
448 451
449 idx = 0; 452 idx = 0;
450 for_each_netdev(net, dev) { 453 for_each_netdev(net, dev) {
451 if (idx < s_idx || (dev->type != ARPHRD_IEEE802154)) 454 /* Check on mtu is currently a hacked solution because lowpan
455 * and wpan have the same ARPHRD type.
456 */
457 if (idx < s_idx || dev->type != ARPHRD_IEEE802154 ||
458 dev->mtu != IEEE802154_MTU)
452 goto cont; 459 goto cont;
453 460
454 if (ieee802154_nl_fill_iface(skb, NETLINK_CB(cb->skb).portid, 461 if (ieee802154_nl_fill_iface(skb, NETLINK_CB(cb->skb).portid,
@@ -782,7 +789,11 @@ ieee802154_llsec_dump_table(struct sk_buff *skb, struct netlink_callback *cb,
782 int rc; 789 int rc;
783 790
784 for_each_netdev(net, dev) { 791 for_each_netdev(net, dev) {
785 if (idx < first_dev || dev->type != ARPHRD_IEEE802154) 792 /* Check on mtu is currently a hacked solution because lowpan
793 * and wpan have the same ARPHRD type.
794 */
795 if (idx < first_dev || dev->type != ARPHRD_IEEE802154 ||
796 dev->mtu != IEEE802154_MTU)
786 goto skip; 797 goto skip;
787 798
788 data.ops = ieee802154_mlme_ops(dev); 799 data.ops = ieee802154_mlme_ops(dev);