Skip to content

Commit c0d6460

Browse files
committed
Merge tag '2.4'
Release 2.4
2 parents 6b51f09 + 53911bf commit c0d6460

12 files changed

Lines changed: 166 additions & 25 deletions

File tree

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ Emmanuel VAUTRIN <Emmanuel.VAUTRIN@cpexterne.org>
3939
Jesse Lentz <jesse@twosheds.org>
4040
Pinghao Wu <xdavidwuph@gmail.com>
4141
Neehar Vijay <env252525@gmail.com>
42+
Jiajie Chen <c@jia.je>

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
ver 2.4:
2+
Fix issue with FT-over-Air and same channel operation.
3+
Fix issue with AP mode and missing support for GTK.
4+
Fix issue with AP mode and channel switch event.
5+
Fix issue with SSID string conversion handling.
6+
17
ver 2.3:
28
Fix issue with length calculation for WMM IE.
39
Fix issue with channel number allocation off-by-one.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AC_PREREQ([2.69])
2-
AC_INIT([iwd],[2.3])
2+
AC_INIT([iwd],[2.4])
33

44
AC_CONFIG_HEADERS(config.h)
55
AC_CONFIG_AUX_DIR(build-aux)

monitor/nlmon.c

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5068,6 +5068,16 @@ static void print_probe_response(unsigned int level,
50685068
(const uint8_t *) mmpdu + len - resp->ies);
50695069
}
50705070

5071+
static void print_beacon(unsigned int level,
5072+
const struct mmpdu_header *mmpdu, size_t len)
5073+
{
5074+
const struct mmpdu_beacon *beacon = mmpdu_body(mmpdu);
5075+
5076+
print_attr(level, "Subtype: Beacon");
5077+
print_ie(level + 1, "Beacon IEs", beacon->ies,
5078+
(const uint8_t *) mmpdu + len - beacon->ies);
5079+
}
5080+
50715081
static void print_frame_type(unsigned int level, const char *label,
50725082
const void *data, uint16_t size)
50735083
{
@@ -5122,7 +5132,10 @@ static void print_frame_type(unsigned int level, const char *label,
51225132
str = "Timing Advertisement";
51235133
break;
51245134
case 0x08:
5125-
str = "Beacon";
5135+
if (mpdu)
5136+
print_beacon(level + 1, mpdu, size);
5137+
else
5138+
str = "Beacon";
51265139
break;
51275140
case 0x09:
51285141
str = "ATIM";
@@ -6240,9 +6253,10 @@ static const struct attr_entry attr_table[] = {
62406253
{ NL80211_ATTR_DTIM_PERIOD,
62416254
"DTIM Period", ATTR_U32 },
62426255
{ NL80211_ATTR_BEACON_HEAD,
6243-
"Beacon Head", ATTR_BINARY },
6256+
"Beacon Head", ATTR_CUSTOM, { .function = print_frame } },
62446257
{ NL80211_ATTR_BEACON_TAIL,
6245-
"Beacon Tail", ATTR_BINARY },
6258+
"Beacon Tail", ATTR_CUSTOM,
6259+
{ .function = print_management_ies } },
62466260
{ NL80211_ATTR_STA_AID,
62476261
"Station AID", ATTR_U16 },
62486262
{ NL80211_ATTR_STA_FLAGS,
@@ -6520,7 +6534,8 @@ static const struct attr_entry attr_table[] = {
65206534
{ NL80211_ATTR_PROBE_RESP_OFFLOAD,
65216535
"Probe Response Offload" },
65226536
{ NL80211_ATTR_PROBE_RESP,
6523-
"Probe Response" },
6537+
"Probe Response", ATTR_CUSTOM,
6538+
{ .function = print_frame} },
65246539
{ NL80211_ATTR_DFS_REGION,
65256540
"DFS Region", ATTR_U8 },
65266541
{ NL80211_ATTR_DISABLE_HT,

src/ap.c

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,14 +1499,19 @@ static void ap_gtk_query_cb(struct l_genl_msg *msg, void *user_data)
14991499
struct sta_state *sta = user_data;
15001500
const void *gtk_rsc;
15011501
uint8_t zero_gtk_rsc[6];
1502+
int err;
15021503

15031504
sta->gtk_query_cmd_id = 0;
15041505

1505-
if (l_genl_msg_get_error(msg) < 0)
1506+
err = l_genl_msg_get_error(msg);
1507+
if (err == -ENOTSUP)
1508+
goto zero_rsc;
1509+
else if (err < 0)
15061510
goto error;
15071511

15081512
gtk_rsc = nl80211_parse_get_key_seq(msg);
15091513
if (!gtk_rsc) {
1514+
zero_rsc:
15101515
memset(zero_gtk_rsc, 0, 6);
15111516
gtk_rsc = zero_gtk_rsc;
15121517
}
@@ -1643,19 +1648,22 @@ static struct l_genl_msg *ap_build_cmd_new_station(struct sta_state *sta)
16431648
{
16441649
struct l_genl_msg *msg;
16451650
uint32_t ifindex = netdev_get_ifindex(sta->ap->netdev);
1646-
/*
1647-
* This should hopefully work both with and without
1648-
* NL80211_FEATURE_FULL_AP_CLIENT_STATE.
1649-
*/
16501651
struct nl80211_sta_flag_update flags = {
1651-
.mask = (1 << NL80211_STA_FLAG_AUTHENTICATED) |
1652-
(1 << NL80211_STA_FLAG_ASSOCIATED) |
1653-
(1 << NL80211_STA_FLAG_AUTHORIZED) |
1652+
.mask = (1 << NL80211_STA_FLAG_AUTHORIZED) |
16541653
(1 << NL80211_STA_FLAG_MFP),
16551654
.set = (1 << NL80211_STA_FLAG_AUTHENTICATED) |
16561655
(1 << NL80211_STA_FLAG_ASSOCIATED),
16571656
};
16581657

1658+
/*
1659+
* Without this feature nl80211 rejects NEW_STATION if the mask contains
1660+
* auth/assoc flags
1661+
*/
1662+
if (wiphy_has_feature(netdev_get_wiphy(sta->ap->netdev),
1663+
NL80211_FEATURE_FULL_AP_CLIENT_STATE))
1664+
flags.mask |= (1 << NL80211_STA_FLAG_ASSOCIATED) |
1665+
(1 << NL80211_STA_FLAG_AUTHENTICATED);
1666+
16591667
msg = l_genl_msg_new_sized(NL80211_CMD_NEW_STATION, 300);
16601668

16611669
l_genl_msg_append_attr(msg, NL80211_ATTR_IFINDEX, 4, &ifindex);
@@ -3660,7 +3668,18 @@ static int ap_load_config(struct ap_state *ap, const struct l_settings *config,
36603668
ap->band = BAND_FREQ_2_4_GHZ;
36613669
}
36623670

3663-
ap->supports_ht = wiphy_get_ht_capabilities(wiphy, ap->band,
3671+
if (l_settings_has_key(config, "General", "DisableHT")) {
3672+
bool boolval;
3673+
3674+
if (!l_settings_get_bool(config, "General", "DisableHT",
3675+
&boolval)) {
3676+
l_error("AP [General].DisableHT not a valid boolean");
3677+
return -EINVAL;
3678+
}
3679+
3680+
ap->supports_ht = !boolval;
3681+
} else
3682+
ap->supports_ht = wiphy_get_ht_capabilities(wiphy, ap->band,
36643683
NULL) != NULL;
36653684

36663685
if (!ap_validate_band_channel(ap)) {

src/eapol.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2783,6 +2783,8 @@ void eapol_register(struct eapol_sm *sm)
27832783

27842784
bool eapol_start(struct eapol_sm *sm)
27852785
{
2786+
l_debug("");
2787+
27862788
if (sm->handshake->settings_8021x) {
27872789
_auto_(l_free) char *network_id = NULL;
27882790

src/ft.c

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
#include "src/offchannel.h"
4141
#include "src/wiphy.h"
4242

43+
static const unsigned int FT_ONCHANNEL_TIME = 300u; /* ms */
44+
4345
static ft_tx_frame_func_t tx_frame = NULL;
4446
static ft_tx_associate_func_t tx_assoc = NULL;
4547
static struct l_queue *info_list = NULL;
@@ -63,6 +65,7 @@ struct ft_info {
6365
struct ie_ft_info ft_info;
6466

6567
bool parsed : 1;
68+
bool onchannel : 1;
6669
};
6770

6871
/*
@@ -1009,8 +1012,17 @@ void __ft_rx_authenticate(uint32_t ifindex, const uint8_t *frame,
10091012
info->parsed = true;
10101013

10111014
cancel:
1012-
/* Verified to be expected target, offchannel can be canceled */
1013-
offchannel_cancel(netdev_get_wdev_id(netdev), info->offchannel_id);
1015+
/*
1016+
* Verified to be expected target, offchannel or onchannel work can
1017+
* now be canceled
1018+
*/
1019+
if (info->onchannel) {
1020+
l_timeout_remove(info->timeout);
1021+
info->timeout = NULL;
1022+
wiphy_radio_work_done(netdev_get_wiphy(netdev), info->work.id);
1023+
} else
1024+
offchannel_cancel(netdev_get_wdev_id(netdev),
1025+
info->offchannel_id);
10141026
}
10151027

10161028
static void ft_send_authenticate(void *user_data)
@@ -1023,6 +1035,8 @@ static void ft_send_authenticate(void *user_data)
10231035
struct iovec iov[2];
10241036
struct mmpdu_authentication auth;
10251037

1038+
l_debug("");
1039+
10261040
/* Authentication body */
10271041
auth.algorithm = L_CPU_TO_LE16(MMPDU_AUTH_ALGO_FT);
10281042
auth.transaction_sequence = L_CPU_TO_LE16(1);
@@ -1079,6 +1093,45 @@ int ft_authenticate(uint32_t ifindex, const struct scan_bss *target)
10791093
return 0;
10801094
}
10811095

1096+
static void ft_onchannel_timeout(struct l_timeout *timeout, void *user_data)
1097+
{
1098+
struct ft_info *info = user_data;
1099+
struct netdev *netdev = netdev_find(info->ifindex);
1100+
1101+
wiphy_radio_work_done(netdev_get_wiphy(netdev), info->work.id);
1102+
}
1103+
1104+
static bool ft_send_authenticate_onchannel(struct wiphy_radio_work_item *work)
1105+
{
1106+
struct ft_info *info = l_container_of(work, struct ft_info, work);
1107+
1108+
ft_send_authenticate(info);
1109+
1110+
info->timeout = l_timeout_create_ms(FT_ONCHANNEL_TIME,
1111+
ft_onchannel_timeout,
1112+
info, NULL);
1113+
return false;
1114+
}
1115+
1116+
struct wiphy_radio_work_item_ops ft_onchannel_ops = {
1117+
.do_work = ft_send_authenticate_onchannel,
1118+
};
1119+
1120+
int ft_authenticate_onchannel(uint32_t ifindex, const struct scan_bss *target)
1121+
{
1122+
struct netdev *netdev = netdev_find(ifindex);
1123+
struct handshake_state *hs = netdev_get_handshake(netdev);
1124+
struct ft_info *info = ft_info_new(hs, target);
1125+
1126+
info->onchannel = true;
1127+
1128+
wiphy_radio_work_insert(netdev_get_wiphy(netdev), &info->work,
1129+
WIPHY_WORK_PRIORITY_FT, &ft_onchannel_ops);
1130+
l_queue_push_tail(info_list, info);
1131+
1132+
return 0;
1133+
}
1134+
10821135
int ft_associate(uint32_t ifindex, const uint8_t *addr)
10831136
{
10841137
struct netdev *netdev = netdev_find(ifindex);

src/ft.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ void ft_clear_authentications(uint32_t ifindex);
4343
int ft_action(uint32_t ifindex, uint32_t freq, const struct scan_bss *target);
4444
int ft_associate(uint32_t ifindex, const uint8_t *addr);
4545
int ft_authenticate(uint32_t ifindex, const struct scan_bss *target);
46+
int ft_authenticate_onchannel(uint32_t ifindex, const struct scan_bss *target);

src/iwd.ap.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ The group ``[General]`` contains general AP configuration.
7373
The time interval at which the AP starts a rekey for a given station. If
7474
not provided a default value of 0 is used (rekeying is disabled).
7575

76+
* - DisableHT
77+
- Boolean value
78+
79+
Explicitly disable HT capabilities for this AP.
80+
7681
Network Authentication Settings
7782
-------------------------------
7883

src/knownnetworks.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,10 @@ static const char *known_network_get_path(const struct network_info *network)
174174

175175
for (i = 0; network->ssid[i] && pos < sizeof(path); i++)
176176
pos += snprintf(path + pos, sizeof(path) - pos, "%02x",
177-
network->ssid[i]);
177+
(unsigned char)network->ssid[i]);
178178

179-
snprintf(path + pos, sizeof(path) - pos, "_%s",
179+
if (pos < sizeof(path))
180+
snprintf(path + pos, sizeof(path) - pos, "_%s",
180181
security_to_str(network->type));
181182
path[sizeof(path) - 1] = '\0';
182183

0 commit comments

Comments
 (0)