提交 78485475 编写于 作者: J Johannes Berg 提交者: John W. Linville

cfg80211: fix netdev down problem

We shouldn't be looking at the ssid_len for non-IBSS,
and for IBSS we should also return an error on trying
to leave an IBSS while not in or joining an IBSS.

This fixes an issue where we wouldn't disconnect() on
an interface being taken down since there's no SSID
configured this way.
Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 c9cf0122
...@@ -567,9 +567,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, ...@@ -567,9 +567,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
#endif #endif
break; break;
case NETDEV_GOING_DOWN: case NETDEV_GOING_DOWN:
if (!wdev->ssid_len)
break;
switch (wdev->iftype) { switch (wdev->iftype) {
case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_ADHOC:
cfg80211_leave_ibss(rdev, dev, true); cfg80211_leave_ibss(rdev, dev, true);
......
...@@ -92,8 +92,12 @@ void cfg80211_clear_ibss(struct net_device *dev, bool nowext) ...@@ -92,8 +92,12 @@ void cfg80211_clear_ibss(struct net_device *dev, bool nowext)
int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev, int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
struct net_device *dev, bool nowext) struct net_device *dev, bool nowext)
{ {
struct wireless_dev *wdev = dev->ieee80211_ptr;
int err; int err;
if (!wdev->ssid_len)
return -ENOLINK;
err = rdev->ops->leave_ibss(&rdev->wiphy, dev); err = rdev->ops->leave_ibss(&rdev->wiphy, dev);
if (err) if (err)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册