ft: netdev: add return value to tx_associate

Prior to this, an error sending the FT Reassociation was treated
as fatal, which is correct for FT-over-Air but not for FT-over-DS.
If the actual l_genl_family_send call fails for FT-over-DS the
existing connection can be maintained and there is no need to
call netdev_connect_failed.

Adding a return to the tx_associate function works for both FT
types. In the FT-over-Air case this return will ultimately get
sent back up to auth_proto_rx_authenticate in which case will
call netdev_connect_failed. For FT-over-DS tx_associate is
actually called from the 'start' operation which can fail and
still maintain the existing connection.
This commit is contained in:
James Prestwood 2021-04-30 10:47:04 -07:00 committed by Denis Kenzior
parent 1b5a58233c
commit 486c859ad6
3 changed files with 6 additions and 8 deletions

View File

@ -287,9 +287,7 @@ static int ft_tx_reassociate(struct ft_sm *ft)
iov_elems += 1;
}
ft->tx_assoc(iov, iov_elems, ft->user_data);
return 0;
return ft->tx_assoc(iov, iov_elems, ft->user_data);
error:
return -EINVAL;

View File

@ -24,7 +24,7 @@ struct handshake_state;
typedef void (*ft_tx_authenticate_func_t)(struct iovec *iov, size_t iov_len,
void *user_data);
typedef void (*ft_tx_associate_func_t)(struct iovec *ie_iov, size_t iov_len,
typedef int (*ft_tx_associate_func_t)(struct iovec *ie_iov, size_t iov_len,
void *user_data);
typedef void (*ft_ds_free_func_t)(void *user_data);

View File

@ -3651,7 +3651,7 @@ restore_snonce:
MMPDU_STATUS_CODE_UNSPECIFIED);
}
static void netdev_ft_tx_associate(struct iovec *ie_iov, size_t iov_len,
static int netdev_ft_tx_associate(struct iovec *ie_iov, size_t iov_len,
void *user_data)
{
struct netdev *netdev = user_data;
@ -3669,9 +3669,7 @@ static void netdev_ft_tx_associate(struct iovec *ie_iov, size_t iov_len,
if (!netdev->connect_cmd_id) {
l_genl_msg_unref(msg);
netdev_connect_failed(netdev, NETDEV_RESULT_ASSOCIATION_FAILED,
MMPDU_STATUS_CODE_UNSPECIFIED);
return;
return -EIO;
}
/* No need to keep this around at this point */
@ -3679,6 +3677,8 @@ static void netdev_ft_tx_associate(struct iovec *ie_iov, size_t iov_len,
ft_ds_info_free(&netdev->ft_ds_info->super);
netdev->ft_ds_info = NULL;
}
return 0;
}
static void prepare_ft(struct netdev *netdev, struct scan_bss *target_bss)