diff --git a/src/netdev.c b/src/netdev.c index 1c5e4ba5..de30e728 100644 --- a/src/netdev.c +++ b/src/netdev.c @@ -2331,6 +2331,9 @@ int netdev_connect(struct netdev *netdev, struct scan_bss *bss, struct eapol_sm *sm = NULL; bool is_rsn = hs->own_ie != NULL; + if (netdev->type != NL80211_IFTYPE_STATION) + return -ENOTSUP; + if (netdev->connected) return -EISCONN; @@ -2360,6 +2363,9 @@ int netdev_connect_wsc(struct netdev *netdev, struct scan_bss *bss, size_t ie_len; struct eapol_sm *sm; + if (netdev->type != NL80211_IFTYPE_STATION) + return -ENOTSUP; + if (netdev->connected) return -EISCONN; @@ -2400,6 +2406,9 @@ int netdev_disconnect(struct netdev *netdev, { struct l_genl_msg *disconnect; + if (netdev->type != NL80211_IFTYPE_STATION) + return -ENOTSUP; + if (!netdev->connected) return -ENOTCONN;