netdev: Fix connections to open networks

Fix a regression where connection to an open network results in an
NotSupported error being returned.

Fixes: d79e883e93 ("netdev: Introduce connection types")
This commit is contained in:
Denis Kenzior 2021-04-20 10:45:25 -05:00
parent 61d0abe910
commit ea324a7959
1 changed files with 5 additions and 0 deletions

View File

@ -3232,6 +3232,11 @@ int netdev_connect(struct netdev *netdev, struct scan_bss *bss,
if (netdev->connected || netdev->connect_cmd_id || netdev->work.id)
return -EISCONN;
if (!is_rsn) {
nhs->type = CONNECTION_TYPE_SOFTMAC;
goto build_cmd_connect;
}
if (netdev_handshake_state_setup_connection_type(hs) < 0)
return -ENOTSUP;