Fix a segfault when deleting the monitor interface
Signed-off-by: Jon Smirl <[email protected]>
---
net/mac802154/main.c | 2 +-
net/mac802154/mib.c | 2 +-
net/mac802154/monitor.c | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/mac802154/main.c b/net/mac802154/main.c
index 7d97756..f5b3cb3 100644
--- a/net/mac802154/main.c
+++ b/net/mac802154/main.c
@@ -99,7 +99,7 @@ static void ieee802154_del_iface(struct wpan_phy *phy,
struct ieee802154_sub_if_data *sdata;
ASSERT_RTNL();
- BUG_ON(dev->type != ARPHRD_IEEE802154);
+ BUG_ON((dev->type != ARPHRD_IEEE802154) && (dev->type !=
ARPHRD_IEEE802154_MONITOR));
sdata = netdev_priv(dev);
diff --git a/net/mac802154/mib.c b/net/mac802154/mib.c
index 73bf62f..6fd17fd 100644
--- a/net/mac802154/mib.c
+++ b/net/mac802154/mib.c
@@ -250,7 +250,7 @@ struct ieee802154_priv *ieee802154_slave_get_priv(struct
net_device *dev)
struct wpan_phy *ieee802154_get_phy(const struct net_device *dev)
{
struct ieee802154_sub_if_data *priv = netdev_priv(dev);
- BUG_ON(dev->type != ARPHRD_IEEE802154);
+ BUG_ON((dev->type != ARPHRD_IEEE802154) && (dev->type !=
ARPHRD_IEEE802154_MONITOR));
return to_phy(get_device(&priv->hw->phy->dev));
}
diff --git a/net/mac802154/monitor.c b/net/mac802154/monitor.c
index 68101d2..98710da 100644
--- a/net/mac802154/monitor.c
+++ b/net/mac802154/monitor.c
@@ -99,6 +99,7 @@ void ieee802154_monitor_setup(struct net_device *dev)
dev->destructor = free_netdev;
dev->netdev_ops = &ieee802154_monitor_ops;
+ dev->ml_priv = &mac802154_mlme;
priv = netdev_priv(dev);
priv->type = IEEE802154_DEV_MONITOR;
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Linux-zigbee-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel