mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-28 21:19:24 +01:00
netdev: Remove vendor_ies from netdev_connect signature
The vendor IEs are now passed in the handshake_state object instead.
This commit is contained in:
parent
0bb181a368
commit
195d1f8720
27
src/netdev.c
27
src/netdev.c
@ -2450,9 +2450,7 @@ static void netdev_driver_connected(struct netdev *netdev)
|
|||||||
|
|
||||||
static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev,
|
static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev,
|
||||||
struct handshake_state *hs,
|
struct handshake_state *hs,
|
||||||
const uint8_t *prev_bssid,
|
const uint8_t *prev_bssid)
|
||||||
const struct iovec *vendor_ies,
|
|
||||||
size_t num_vendor_ies)
|
|
||||||
{
|
{
|
||||||
struct netdev_handshake_state *nhs =
|
struct netdev_handshake_state *nhs =
|
||||||
l_container_of(hs, struct netdev_handshake_state, super);
|
l_container_of(hs, struct netdev_handshake_state, super);
|
||||||
@ -2529,12 +2527,6 @@ static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev,
|
|||||||
|
|
||||||
mpdu_sort_ies(subtype, iov, c_iov);
|
mpdu_sort_ies(subtype, iov, c_iov);
|
||||||
|
|
||||||
if (vendor_ies && !L_WARN_ON(n_iov - c_iov < num_vendor_ies)) {
|
|
||||||
memcpy(iov + c_iov, vendor_ies,
|
|
||||||
sizeof(*vendor_ies) * num_vendor_ies);
|
|
||||||
c_iov += num_vendor_ies;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c_iov)
|
if (c_iov)
|
||||||
l_genl_msg_append_attrv(msg, NL80211_ATTR_IE, iov, c_iov);
|
l_genl_msg_append_attrv(msg, NL80211_ATTR_IE, iov, c_iov);
|
||||||
|
|
||||||
@ -2570,8 +2562,7 @@ static bool netdev_retry_owe(struct netdev *netdev)
|
|||||||
if (!owe_next_group(netdev->owe_sm))
|
if (!owe_next_group(netdev->owe_sm))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
connect_cmd = netdev_build_cmd_connect(netdev,
|
connect_cmd = netdev_build_cmd_connect(netdev, netdev->handshake, NULL);
|
||||||
netdev->handshake, NULL, NULL, 0);
|
|
||||||
|
|
||||||
netdev->connect_cmd_id = l_genl_family_send(nl80211, connect_cmd,
|
netdev->connect_cmd_id = l_genl_family_send(nl80211, connect_cmd,
|
||||||
netdev_cmd_connect_cb, netdev,
|
netdev_cmd_connect_cb, netdev,
|
||||||
@ -3807,8 +3798,6 @@ static void netdev_connect_common(struct netdev *netdev,
|
|||||||
const struct scan_bss *bss,
|
const struct scan_bss *bss,
|
||||||
const struct scan_bss *prev_bss,
|
const struct scan_bss *prev_bss,
|
||||||
struct handshake_state *hs,
|
struct handshake_state *hs,
|
||||||
const struct iovec *vendor_ies,
|
|
||||||
size_t num_vendor_ies,
|
|
||||||
netdev_event_func_t event_filter,
|
netdev_event_func_t event_filter,
|
||||||
netdev_connect_cb_t cb, void *user_data)
|
netdev_connect_cb_t cb, void *user_data)
|
||||||
{
|
{
|
||||||
@ -3866,8 +3855,7 @@ static void netdev_connect_common(struct netdev *netdev,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
build_cmd_connect:
|
build_cmd_connect:
|
||||||
cmd_connect = netdev_build_cmd_connect(netdev, hs, prev_bssid,
|
cmd_connect = netdev_build_cmd_connect(netdev, hs, prev_bssid);
|
||||||
vendor_ies, num_vendor_ies);
|
|
||||||
|
|
||||||
if (!is_offload(hs) && (is_rsn || hs->settings_8021x)) {
|
if (!is_offload(hs) && (is_rsn || hs->settings_8021x)) {
|
||||||
sm = eapol_sm_new(hs);
|
sm = eapol_sm_new(hs);
|
||||||
@ -3900,8 +3888,6 @@ build_cmd_connect:
|
|||||||
|
|
||||||
int netdev_connect(struct netdev *netdev, const struct scan_bss *bss,
|
int netdev_connect(struct netdev *netdev, const struct scan_bss *bss,
|
||||||
struct handshake_state *hs,
|
struct handshake_state *hs,
|
||||||
const struct iovec *vendor_ies,
|
|
||||||
size_t num_vendor_ies,
|
|
||||||
netdev_event_func_t event_filter,
|
netdev_event_func_t event_filter,
|
||||||
netdev_connect_cb_t cb, void *user_data)
|
netdev_connect_cb_t cb, void *user_data)
|
||||||
{
|
{
|
||||||
@ -3918,9 +3904,8 @@ int netdev_connect(struct netdev *netdev, const struct scan_bss *bss,
|
|||||||
if (netdev_handshake_state_setup_connection_type(hs) < 0)
|
if (netdev_handshake_state_setup_connection_type(hs) < 0)
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
||||||
netdev_connect_common(netdev, bss, NULL, hs, vendor_ies,
|
netdev_connect_common(netdev, bss, NULL, hs,
|
||||||
num_vendor_ies, event_filter, cb,
|
event_filter, cb, user_data);
|
||||||
user_data);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -4025,7 +4010,7 @@ int netdev_reassociate(struct netdev *netdev, const struct scan_bss *target_bss,
|
|||||||
netdev->connected = false;
|
netdev->connected = false;
|
||||||
netdev->in_reassoc = true;
|
netdev->in_reassoc = true;
|
||||||
|
|
||||||
netdev_connect_common(netdev, target_bss, orig_bss, hs, NULL, 0,
|
netdev_connect_common(netdev, target_bss, orig_bss, hs,
|
||||||
event_filter, cb, user_data);
|
event_filter, cb, user_data);
|
||||||
|
|
||||||
if (netdev->ap)
|
if (netdev->ap)
|
||||||
|
@ -155,8 +155,6 @@ struct handshake_state *netdev_get_handshake(struct netdev *netdev);
|
|||||||
|
|
||||||
int netdev_connect(struct netdev *netdev, const struct scan_bss *bss,
|
int netdev_connect(struct netdev *netdev, const struct scan_bss *bss,
|
||||||
struct handshake_state *hs,
|
struct handshake_state *hs,
|
||||||
const struct iovec *vendor_ies,
|
|
||||||
size_t num_vendor_ies,
|
|
||||||
netdev_event_func_t event_filter,
|
netdev_event_func_t event_filter,
|
||||||
netdev_connect_cb_t cb, void *user_data);
|
netdev_connect_cb_t cb, void *user_data);
|
||||||
int netdev_disconnect(struct netdev *netdev,
|
int netdev_disconnect(struct netdev *netdev,
|
||||||
|
@ -1555,7 +1555,7 @@ static void p2p_try_connect_group(struct p2p_device *dev)
|
|||||||
if (dev->conn_peer_capability.group_caps & P2P_GROUP_CAP_IP_ALLOCATION)
|
if (dev->conn_peer_capability.group_caps & P2P_GROUP_CAP_IP_ALLOCATION)
|
||||||
hs->support_ip_allocation = true;
|
hs->support_ip_allocation = true;
|
||||||
|
|
||||||
r = netdev_connect(dev->conn_netdev, bss, hs, NULL, 0,
|
r = netdev_connect(dev->conn_netdev, bss, hs,
|
||||||
p2p_netdev_event, p2p_netdev_connect_cb, dev);
|
p2p_netdev_event, p2p_netdev_connect_cb, dev);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
l_error("netdev_connect error: %s (%i)", strerror(-r), -r);
|
l_error("netdev_connect error: %s (%i)", strerror(-r), -r);
|
||||||
|
@ -3453,7 +3453,7 @@ int __station_connect_network(struct station *station, struct network *network,
|
|||||||
if (!hs)
|
if (!hs)
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
||||||
r = netdev_connect(station->netdev, bss, hs, NULL, 0,
|
r = netdev_connect(station->netdev, bss, hs,
|
||||||
station_netdev_event,
|
station_netdev_event,
|
||||||
station_connect_cb, station);
|
station_connect_cb, station);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
|
@ -384,7 +384,7 @@ static int wsc_enrollee_connect(struct wsc_enrollee *wsce, struct scan_bss *bss,
|
|||||||
|
|
||||||
handshake_state_set_vendor_ies(hs, ie_iov, 1 + ies_num);
|
handshake_state_set_vendor_ies(hs, ie_iov, 1 + ies_num);
|
||||||
|
|
||||||
r = netdev_connect(wsce->netdev, bss, hs, NULL, 0,
|
r = netdev_connect(wsce->netdev, bss, hs,
|
||||||
wsc_enrollee_netdev_event,
|
wsc_enrollee_netdev_event,
|
||||||
wsc_enrollee_connect_cb, wsce);
|
wsc_enrollee_connect_cb, wsce);
|
||||||
l_free(ie_iov[0].iov_base);
|
l_free(ie_iov[0].iov_base);
|
||||||
|
Loading…
Reference in New Issue
Block a user