Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
HardenedBSD
HardenedBSD
Commits
266f97b5
Commit
266f97b5
authored
Dec 02, 2021
by
Cy Schubert
Browse files
wpa: Import wpa_supplicant/hostapd commit 14ab4a816
This is the November update to vendor/wpa committed upstream 2021-11-26. MFC after: 1 month
parents
a10253cf
56f32b0e
Changes
175
Hide whitespace changes
Inline
Side-by-side
ObsoleteFiles.inc
View file @
266f97b5
...
...
@@ -504,8 +504,6 @@ OLD_FILES+=usr/share/man/man4/iscsi_initiator.4.gz
OLD_FILES+=usr/share/man/man8/iscontrol.8.gz
# 20211022
OLD_FILES+=etc/rc.d/sppp
OLD_FILES+=rescue/spppcontrol
OLD_FILES+=sbin/spppcontrol
.if ${TARGET_ARCH} == "i386"
OLD_FILES+=usr/include/machine/cserial.h
...
...
@@ -516,26 +514,11 @@ OLD_FILES+=usr/share/man/man4/ng_sppp.4.gz
OLD_FILES+=usr/share/man/man4/sppp.4.gz
OLD_FILES+=usr/share/man/man8/spppcontrol.8.gz
# 20211004: Removed sparc64 tests for lastcomm/sa
OLD_FILES+=usr/tests/usr.bin/lastcomm/v1-sparc64-acct.in
OLD_FILES+=usr/tests/usr.bin/lastcomm/v1-sparc64.out
OLD_FILES+=usr/tests/usr.bin/lastcomm/v2-sparc64-acct.in
OLD_FILES+=usr/tests/usr.bin/lastcomm/v2-sparc64.out
OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-sav.in
OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-sav.out
OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-u.out
OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-usr.in
OLD_FILES+=usr/tests/usr.sbin/sa/v1-sparc64-usr.out
OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-sav.in
OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-u.out
OLD_FILES+=usr/tests/usr.sbin/sa/v2-sparc64-usr.in
# 20210929:
OLD_FILES+=usr/sbin/hcseriald
OLD_FILES+=usr/share/man/man8/hcseriald.8.gz
# 20210929: Remove ng_h4
OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_h4.h
OLD_FILES+=usr/share/man/man4/ng_h4.4.gz
# 20210923: rename boot(9) to kern_reboot(9)
...
...
@@ -543,8 +526,6 @@ OLD_FILES+=usr/share/man/man9/boot.9.gz
# 20210921: remove cloudabi
OLD_FILES+=usr/share/man/man4/cloudabi.4.gz
OLD_FILES+=usr/share/man/man4/cloudabi32.4.gz
OLD_FILES+=usr/share/man/man4/cloudabi64.4.gz
# 20210906: stop installing {llvm,clang,lldb}-tblgen
OLD_FILES+=usr/bin/llvm-tblgen
...
...
contrib/wpa/hostapd/config_file.c
View file @
266f97b5
...
...
@@ -13,6 +13,7 @@
#include
"utils/common.h"
#include
"utils/uuid.h"
#include
"utils/crc32.h"
#include
"common/ieee802_11_defs.h"
#include
"common/sae.h"
#include
"crypto/sha256.h"
...
...
@@ -2396,16 +2397,19 @@ static int hostapd_config_fill(struct hostapd_config *conf,
wpa_printf
(
MSG_INFO
,
"Line %d: DEPRECATED: 'dump_file' configuration variable is not used anymore"
,
line
);
}
else
if
(
os_strcmp
(
buf
,
"ssid"
)
==
0
)
{
bss
->
ssid
.
ssid_len
=
os_strlen
(
pos
);
if
(
bss
->
ssid
.
ssid_len
>
SSID_MAX_LEN
||
bss
->
ssid
.
ssid_len
<
1
)
{
struct
hostapd_ssid
*
ssid
=
&
bss
->
ssid
;
ssid
->
ssid_len
=
os_strlen
(
pos
);
if
(
ssid
->
ssid_len
>
SSID_MAX_LEN
||
ssid
->
ssid_len
<
1
)
{
wpa_printf
(
MSG_ERROR
,
"Line %d: invalid SSID '%s'"
,
line
,
pos
);
return
1
;
}
os_memcpy
(
bss
->
ssid
.
ssid
,
pos
,
bss
->
ssid
.
ssid_len
);
bss
->
ssid
.
ssid_set
=
1
;
os_memcpy
(
ssid
->
ssid
,
pos
,
ssid
->
ssid_len
);
ssid
->
ssid_set
=
1
;
ssid
->
short_ssid
=
crc32
(
ssid
->
ssid
,
ssid
->
ssid_len
);
}
else
if
(
os_strcmp
(
buf
,
"ssid2"
)
==
0
)
{
struct
hostapd_ssid
*
ssid
=
&
bss
->
ssid
;
size_t
slen
;
char
*
str
=
wpa_config_parse_string
(
pos
,
&
slen
);
if
(
str
==
NULL
||
slen
<
1
||
slen
>
SSID_MAX_LEN
)
{
...
...
@@ -2414,9 +2418,10 @@ static int hostapd_config_fill(struct hostapd_config *conf,
os_free
(
str
);
return
1
;
}
os_memcpy
(
bss
->
ssid
.
ssid
,
str
,
slen
);
bss
->
ssid
.
ssid_len
=
slen
;
bss
->
ssid
.
ssid_set
=
1
;
os_memcpy
(
ssid
->
ssid
,
str
,
slen
);
ssid
->
ssid_len
=
slen
;
ssid
->
ssid_set
=
1
;
ssid
->
short_ssid
=
crc32
(
ssid
->
ssid
,
ssid
->
ssid_len
);
os_free
(
str
);
}
else
if
(
os_strcmp
(
buf
,
"utf8_ssid"
)
==
0
)
{
bss
->
ssid
.
utf8_ssid
=
atoi
(
pos
)
>
0
;
...
...
@@ -3515,6 +3520,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
conf
->
he_op
.
he_twt_responder
=
atoi
(
pos
);
}
else
if
(
os_strcmp
(
buf
,
"he_rts_threshold"
)
==
0
)
{
conf
->
he_op
.
he_rts_threshold
=
atoi
(
pos
);
}
else
if
(
os_strcmp
(
buf
,
"he_er_su_disable"
)
==
0
)
{
conf
->
he_op
.
he_er_su_disable
=
atoi
(
pos
);
}
else
if
(
os_strcmp
(
buf
,
"he_basic_mcs_nss_set"
)
==
0
)
{
conf
->
he_op
.
he_basic_mcs_nss_set
=
atoi
(
pos
);
}
else
if
(
os_strcmp
(
buf
,
"he_mu_edca_qos_info_param_count"
)
==
0
)
{
...
...
@@ -4705,6 +4712,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
if
(
get_hex_config
(
bss
->
ext_capa
,
EXT_CAPA_MAX_LEN
,
line
,
"ext_capa"
,
pos
))
return
1
;
}
else
if
(
os_strcmp
(
buf
,
"rnr"
)
==
0
)
{
bss
->
rnr
=
atoi
(
pos
);
}
else
{
wpa_printf
(
MSG_ERROR
,
"Line %d: unknown configuration item '%s'"
,
...
...
contrib/wpa/hostapd/ctrl_iface.c
View file @
266f97b5
...
...
@@ -840,7 +840,7 @@ static int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
const
char
*
pos
,
*
end
;
int
disassoc_timer
=
0
;
struct
sta_info
*
sta
;
u8
req_mode
=
0
,
valid_int
=
0x01
;
u8
req_mode
=
0
,
valid_int
=
0x01
,
dialog_token
=
0x01
;
u8
bss_term_dur
[
12
];
char
*
url
=
NULL
;
int
ret
;
...
...
@@ -878,6 +878,12 @@ static int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
valid_int
=
atoi
(
pos
);
}
pos
=
os_strstr
(
cmd
,
" dialog_token="
);
if
(
pos
)
{
pos
+=
14
;
dialog_token
=
atoi
(
pos
);
}
pos
=
os_strstr
(
cmd
,
" bss_term="
);
if
(
pos
)
{
pos
+=
10
;
...
...
@@ -984,7 +990,7 @@ static int hostapd_ctrl_iface_bss_tm_req(struct hostapd_data *hapd,
#endif
/* CONFIG_MBO */
ret
=
wnm_send_bss_tm_req
(
hapd
,
sta
,
req_mode
,
disassoc_timer
,
valid_int
,
bss_term_dur
,
url
,
valid_int
,
bss_term_dur
,
dialog_token
,
url
,
nei_len
?
nei_rep
:
NULL
,
nei_len
,
mbo_len
?
mbo
:
NULL
,
mbo_len
);
#ifdef CONFIG_MBO
...
...
@@ -1455,10 +1461,10 @@ static int hostapd_ctrl_iface_set(struct hostapd_data *hapd, char *cmd)
wps_version_number
&
0x0f
);
hostapd_wps_update_ie
(
hapd
);
}
}
else
if
(
os_strcasecmp
(
cmd
,
"wps_testing_
dummy
_cred"
)
==
0
)
{
wps_testing_
dummy
_cred
=
atoi
(
value
);
wpa_printf
(
MSG_DEBUG
,
"WPS: Testing -
dummy
_cred=%d"
,
wps_testing_
dummy
_cred
);
}
else
if
(
os_strcasecmp
(
cmd
,
"wps_testing_
stub
_cred"
)
==
0
)
{
wps_testing_
stub
_cred
=
atoi
(
value
);
wpa_printf
(
MSG_DEBUG
,
"WPS: Testing -
stub
_cred=%d"
,
wps_testing_
stub
_cred
);
}
else
if
(
os_strcasecmp
(
cmd
,
"wps_corrupt_pkhash"
)
==
0
)
{
wps_corrupt_pkhash
=
atoi
(
value
);
wpa_printf
(
MSG_DEBUG
,
"WPS: Testing - wps_corrupt_pkhash=%d"
,
...
...
@@ -3185,8 +3191,9 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf)
u8
bssid
[
ETH_ALEN
];
struct
wpabuf
*
nr
,
*
lci
=
NULL
,
*
civic
=
NULL
;
int
stationary
=
0
;
int
bss_parameters
=
0
;
char
*
tmp
;
int
ret
;
int
ret
=
-
1
;
if
(
!
(
hapd
->
conf
->
radio_measurements
[
0
]
&
WLAN_RRM_CAPS_NEIGHBOR_REPORT
))
{
...
...
@@ -3240,8 +3247,7 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf)
if
(
!
lci
)
{
wpa_printf
(
MSG_ERROR
,
"CTRL: SET_NEIGHBOR: Bad LCI subelement"
);
wpabuf_free
(
nr
);
return
-
1
;
goto
fail
;
}
}
...
...
@@ -3257,9 +3263,7 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf)
if
(
!
civic
)
{
wpa_printf
(
MSG_ERROR
,
"CTRL: SET_NEIGHBOR: Bad civic subelement"
);
wpabuf_free
(
nr
);
wpabuf_free
(
lci
);
return
-
1
;
goto
fail
;
}
}
...
...
@@ -3269,10 +3273,21 @@ static int hostapd_ctrl_iface_set_neighbor(struct hostapd_data *hapd, char *buf)
if
(
os_strstr
(
buf
,
"stat"
))
stationary
=
1
;
tmp
=
os_strstr
(
buf
,
"bss_parameter="
);
if
(
tmp
)
{
bss_parameters
=
atoi
(
tmp
+
14
);
if
(
bss_parameters
<
0
||
bss_parameters
>
0xff
)
{
wpa_printf
(
MSG_ERROR
,
"CTRL: SET_NEIGHBOR: Bad bss_parameters subelement"
);
goto
fail
;
}
}
set:
ret
=
hostapd_neighbor_set
(
hapd
,
bssid
,
&
ssid
,
nr
,
lci
,
civic
,
stationary
);
stationary
,
bss_parameters
);
fail:
wpabuf_free
(
nr
);
wpabuf_free
(
lci
);
wpabuf_free
(
civic
);
...
...
@@ -4470,7 +4485,7 @@ static void hostapd_ctrl_iface_flush(struct hapd_interfaces *interfaces)
{
#ifdef CONFIG_WPS_TESTING
wps_version_number
=
0x20
;
wps_testing_
dummy
_cred
=
0
;
wps_testing_
stub
_cred
=
0
;
wps_corrupt_pkhash
=
0
;
#endif
/* CONFIG_WPS_TESTING */
...
...
contrib/wpa/hostapd/hlr_auc_gw.milenage_db
View file @
266f97b5
...
...
@@ -3,7 +3,7 @@
# 4.3.20 Test Set 20. SQN is the last used SQN value.
# These values can be used for both UMTS (EAP-AKA) and GSM (EAP-SIM)
# authentication. In case of GSM/EAP-SIM, AMF and SQN values are not used, but
#
dummy
values will need to be included in this file.
#
stub
values will need to be included in this file.
# IMSI Ki OPc AMF SQN [RES_len]
232010000000000 90dca4eda45b53cf0f12d7c9c3bc6a89 cb9cccc4b9258e6dca4760379fb82581 61df 000000000000
...
...
contrib/wpa/hostapd/hostapd.conf
View file @
266f97b5
...
...
@@ -841,6 +841,11 @@ wmm_ac_vo_acm=0
# unsigned integer = duration in units of 16 us
#he_rts_threshold=0
#he_er_su_disable: Disable 242-tone HE ER SU PPDU reception by the AP
# 0 = enable reception (default)
# 1 = disable reception
#he_er_su_disable=0
# HE operating channel information; see matching vht_* parameters for details.
# he_oper_centr_freq_seg0_idx field is used to indicate center frequency of 80
# and 160 MHz bandwidth operation. In 80+80 MHz operation, it is the center
...
...
@@ -1832,7 +1837,7 @@ own_ip_addr=127.0.0.1
#assoc_sa_query_retry_timeout=201
# ocv: Operating Channel Validation
# This is a countermeasure against multi-channel
man-in-the-middle
attacks.
# This is a countermeasure against multi-channel
on-path
attacks.
# Enabling this depends on the driver's support for OCV when the driver SME is
# used. If hostapd SME is used, this will be enabled just based on this
# configuration.
...
...
@@ -2916,6 +2921,9 @@ own_ip_addr=127.0.0.1
# that allows sending of such data. Default: 0.
#stationary_ap=0
# Enable reduced neighbor reporting (RNR)
#rnr=0
##### Airtime policy configuration ###########################################
# Set the airtime policy operating mode:
...
...
contrib/wpa/hostapd/hostapd_cli.c
View file @
266f97b5
...
...
@@ -1048,7 +1048,7 @@ static char ** hostapd_complete_set(const char *str, int pos)
int
arg
=
get_cmd_arg_num
(
str
,
pos
);
const
char
*
fields
[]
=
{
#ifdef CONFIG_WPS_TESTING
"wps_version_number"
,
"wps_testing_
dummy
_cred"
,
"wps_version_number"
,
"wps_testing_
stub
_cred"
,
"wps_corrupt_pkhash"
,
#endif
/* CONFIG_WPS_TESTING */
#ifdef CONFIG_INTERWORKING
...
...
contrib/wpa/src/ap/acs.c
View file @
266f97b5
...
...
@@ -309,8 +309,6 @@ acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf)
else
if
(
survey
->
filled
&
SURVEY_HAS_CHAN_TIME_RX
)
busy
=
survey
->
channel_time_rx
;
else
{
/* This shouldn't really happen as survey data is checked in
* acs_sanity_check() */
wpa_printf
(
MSG_ERROR
,
"ACS: Survey data missing"
);
return
0
;
}
...
...
@@ -392,7 +390,7 @@ static int acs_usable_bw40_chan(const struct hostapd_channel_data *chan)
static
int
acs_usable_bw80_chan
(
const
struct
hostapd_channel_data
*
chan
)
{
const
int
allowed
[]
=
{
5180
,
5260
,
55
5
0
,
5580
,
5660
,
5745
,
5955
,
6035
,
const
int
allowed
[]
=
{
5180
,
5260
,
55
0
0
,
5580
,
5660
,
5745
,
5955
,
6035
,
6115
,
6195
,
6275
,
6355
,
6435
,
6515
,
6595
,
6675
,
6755
,
6835
,
6915
,
6995
};
unsigned
int
i
;
...
...
contrib/wpa/src/ap/ap_config.c
View file @
266f97b5
...
...
@@ -273,7 +273,7 @@ struct hostapd_config * hostapd_config_defaults(void)
conf
->
he_op
.
he_basic_mcs_nss_set
=
0xfffc
;
conf
->
he_op
.
he_bss_color_disabled
=
1
;
conf
->
he_op
.
he_bss_color_partial
=
0
;
conf
->
he_op
.
he_bss_color
=
1
;
conf
->
he_op
.
he_bss_color
=
os_random
()
%
63
+
1
;
conf
->
he_op
.
he_twt_responder
=
1
;
conf
->
he_6ghz_max_mpdu
=
2
;
conf
->
he_6ghz_max_ampdu_len_exp
=
7
;
...
...
@@ -1423,6 +1423,15 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
}
#endif
/* CONFIG_SAE_PK */
#ifdef CONFIG_FILS
if
(
full_config
&&
bss
->
fils_discovery_min_int
&&
bss
->
unsol_bcast_probe_resp_interval
)
{
wpa_printf
(
MSG_ERROR
,
"Cannot enable both FILS discovery and unsolicited broadcast Probe Response at the same time"
);
return
-
1
;
}
#endif
/* CONFIG_FILS */
return
0
;
}
...
...
contrib/wpa/src/ap/ap_config.h
View file @
266f97b5
...
...
@@ -894,6 +894,8 @@ struct hostapd_bss_config {
u8
ext_capa_mask
[
EXT_CAPA_MAX_LEN
];
u8
ext_capa
[
EXT_CAPA_MAX_LEN
];
u8
rnr
;
};
/**
...
...
@@ -916,6 +918,7 @@ struct he_operation {
u8
he_twt_required
;
u8
he_twt_responder
;
u16
he_rts_threshold
;
u8
he_er_su_disable
;
u16
he_basic_mcs_nss_set
;
};
...
...
contrib/wpa/src/ap/beacon.c
View file @
266f97b5
...
...
@@ -469,6 +469,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
}
#endif
/* CONFIG_IEEE80211AX */
buflen
+=
hostapd_eid_rnr_len
(
hapd
,
WLAN_FC_STYPE_PROBE_RESP
);
buflen
+=
hostapd_mbo_ie_len
(
hapd
);
buflen
+=
hostapd_eid_owe_trans_len
(
hapd
);
buflen
+=
hostapd_eid_dpp_cc_len
(
hapd
);
...
...
@@ -573,6 +574,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
(
hapd
->
iconf
->
ieee80211ax
&&
!
hapd
->
conf
->
disable_11ax
))
pos
=
hostapd_eid_wb_chsw_wrapper
(
hapd
,
pos
);
pos
=
hostapd_eid_rnr
(
hapd
,
pos
,
WLAN_FC_STYPE_PROBE_RESP
);
pos
=
hostapd_eid_fils_indic
(
hapd
,
pos
,
0
);
pos
=
hostapd_get_rsnxe
(
hapd
,
pos
,
epos
-
pos
);
...
...
@@ -642,7 +644,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
enum
ssid_match_result
{
NO_SSID_MATCH
,
EXACT_SSID_MATCH
,
WILDCARD_SSID_MATCH
WILDCARD_SSID_MATCH
,
CO_LOCATED_SSID_MATCH
,
};
static
enum
ssid_match_result
ssid_match
(
struct
hostapd_data
*
hapd
,
...
...
@@ -653,7 +656,9 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd,
size_t
short_ssid_list_len
)
{
const
u8
*
pos
,
*
end
;
struct
hostapd_iface
*
iface
=
hapd
->
iface
;
int
wildcard
=
0
;
size_t
i
,
j
;
if
(
ssid_len
==
0
)
wildcard
=
1
;
...
...
@@ -687,7 +692,33 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd,
}
}
return
wildcard
?
WILDCARD_SSID_MATCH
:
NO_SSID_MATCH
;
if
(
wildcard
)
return
WILDCARD_SSID_MATCH
;
if
(
!
iface
->
interfaces
||
iface
->
interfaces
->
count
<=
1
||
is_6ghz_op_class
(
hapd
->
iconf
->
op_class
))
return
NO_SSID_MATCH
;
for
(
i
=
0
;
i
<
iface
->
interfaces
->
count
;
i
++
)
{
struct
hostapd_iface
*
colocated
;
colocated
=
iface
->
interfaces
->
iface
[
i
];
if
(
colocated
==
iface
||
!
is_6ghz_op_class
(
colocated
->
conf
->
op_class
))
continue
;
for
(
j
=
0
;
j
<
colocated
->
num_bss
;
j
++
)
{
struct
hostapd_bss_config
*
conf
;
conf
=
colocated
->
bss
[
j
]
->
conf
;
if
(
ssid_len
==
conf
->
ssid
.
ssid_len
&&
os_memcmp
(
ssid
,
conf
->
ssid
.
ssid
,
ssid_len
)
==
0
)
return
CO_LOCATED_SSID_MATCH
;
}
}
return
NO_SSID_MATCH
;
}
...
...
@@ -1284,6 +1315,8 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len)
total_len
+=
3
;
}
total_len
+=
hostapd_eid_rnr_len
(
hapd
,
WLAN_FC_STYPE_ACTION
);
pos
=
hostapd_eid_fils_indic
(
hapd
,
buf
,
0
);
buf_len
=
pos
-
buf
;
total_len
+=
buf_len
;
...
...
@@ -1352,6 +1385,8 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len)
/* Fill in the Length field value */
*
length_pos
=
pos
-
(
length_pos
+
1
);
pos
=
hostapd_eid_rnr
(
hapd
,
pos
,
WLAN_FC_STYPE_ACTION
);
/* FILS Indication element */
if
(
buf_len
)
{
os_memcpy
(
pos
,
buf
,
buf_len
);
...
...
@@ -1438,6 +1473,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
}
#endif
/* CONFIG_IEEE80211AX */
tail_len
+=
hostapd_eid_rnr_len
(
hapd
,
WLAN_FC_STYPE_BEACON
);
tail_len
+=
hostapd_mbo_ie_len
(
hapd
);
tail_len
+=
hostapd_eid_owe_trans_len
(
hapd
);
tail_len
+=
hostapd_eid_dpp_cc_len
(
hapd
);
...
...
@@ -1562,6 +1598,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
(
hapd
->
iconf
->
ieee80211ax
&&
!
hapd
->
conf
->
disable_11ax
))
tailpos
=
hostapd_eid_wb_chsw_wrapper
(
hapd
,
tailpos
);
tailpos
=
hostapd_eid_rnr
(
hapd
,
tailpos
,
WLAN_FC_STYPE_BEACON
);
tailpos
=
hostapd_eid_fils_indic
(
hapd
,
tailpos
,
0
);
tailpos
=
hostapd_get_rsnxe
(
hapd
,
tailpos
,
tailend
-
tailpos
);
...
...
@@ -1743,7 +1780,7 @@ void ieee802_11_free_ap_params(struct wpa_driver_ap_params *params)
}
int
ieee802_11_set_beacon
(
struct
hostapd_data
*
hapd
)
static
int
__
ieee802_11_set_beacon
(
struct
hostapd_data
*
hapd
)
{
struct
wpa_driver_ap_params
params
;
struct
hostapd_freq_params
freq
;
...
...
@@ -1832,6 +1869,42 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd)
}
int
ieee802_11_set_beacon
(
struct
hostapd_data
*
hapd
)
{
struct
hostapd_iface
*
iface
=
hapd
->
iface
;
int
ret
;
size_t
i
,
j
;
bool
is_6g
;
ret
=
__ieee802_11_set_beacon
(
hapd
);
if
(
ret
!=
0
)
return
ret
;
if
(
!
iface
->
interfaces
||
iface
->
interfaces
->
count
<=
1
)
return
0
;
/* Update Beacon frames in case of 6 GHz colocation */
is_6g
=
is_6ghz_op_class
(
iface
->
conf
->
op_class
);
for
(
j
=
0
;
j
<
iface
->
interfaces
->
count
;
j
++
)
{
struct
hostapd_iface
*
colocated
;
colocated
=
iface
->
interfaces
->
iface
[
j
];
if
(
colocated
==
iface
||
!
colocated
||
!
colocated
->
conf
)
continue
;
if
(
is_6g
==
is_6ghz_op_class
(
colocated
->
conf
->
op_class
))
continue
;
for
(
i
=
0
;
i
<
colocated
->
num_bss
;
i
++
)
{
if
(
colocated
->
bss
[
i
]
&&
colocated
->
bss
[
i
]
->
started
)
__ieee802_11_set_beacon
(
colocated
->
bss
[
i
]);
}
}
return
0
;
}
int
ieee802_11_set_beacons
(
struct
hostapd_iface
*
iface
)
{
size_t
i
;
...
...
contrib/wpa/src/ap/ctrl_iface_ap.c
View file @
266f97b5
...
...
@@ -50,9 +50,35 @@ static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen,
}
static
int
hostapd_get_sta_tx_rx
(
struct
hostapd_data
*
hapd
,
struct
sta_info
*
sta
,
char
*
buf
,
size_t
buflen
)
static
int
hostapd_get_sta_conn_time
(
struct
sta_info
*
sta
,
struct
hostap_sta_driver_data
*
data
,
char
*
buf
,
size_t
buflen
)
{
struct
os_reltime
age
;
unsigned
long
secs
;
int
ret
;
if
(
sta
->
connected_time
.
sec
)
{
/* Locally maintained time in AP mode */
os_reltime_age
(
&
sta
->
connected_time
,
&
age
);
secs
=
(
unsigned
long
)
age
.
sec
;
}
else
if
(
data
->
flags
&
STA_DRV_DATA_CONN_TIME
)
{
/* Time from the driver in mesh mode */
secs
=
data
->
connected_sec
;
}
else
{
return
0
;
}
ret
=
os_snprintf
(
buf
,
buflen
,
"connected_time=%lu
\n
"
,
secs
);
if
(
os_snprintf_error
(
buflen
,
ret
))
return
0
;
return
ret
;
}
static
int
hostapd_get_sta_info
(
struct
hostapd_data
*
hapd
,
struct
sta_info
*
sta
,
char
*
buf
,
size_t
buflen
)
{
struct
hostap_sta_driver_data
data
;
int
ret
;
...
...
@@ -160,26 +186,9 @@ static int hostapd_get_sta_tx_rx(struct hostapd_data *hapd,
len
+=
ret
;
}
return
len
;
}
len
+=
hostapd_get_sta_conn_time
(
sta
,
&
data
,
buf
+
len
,
buflen
-
len
);
static
int
hostapd_get_sta_conn_time
(
struct
sta_info
*
sta
,
char
*
buf
,
size_t
buflen
)
{
struct
os_reltime
age
;
int
ret
;
if
(
!
sta
->
connected_time
.
sec
)
return
0
;
os_reltime_age
(
&
sta
->
connected_time
,
&
age
);
ret
=
os_snprintf
(
buf
,
buflen
,
"connected_time=%u
\n
"
,
(
unsigned
int
)
age
.
sec
);
if
(
os_snprintf_error
(
buflen
,
ret
))
return
0
;
return
ret
;
return
len
;
}
...
...
@@ -263,8 +272,7 @@ static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
if
(
res
>=
0
)
len
+=
res
;
len
+=
hostapd_get_sta_tx_rx
(
hapd
,
sta
,
buf
+
len
,
buflen
-
len
);
len
+=
hostapd_get_sta_conn_time
(
sta
,
buf
+
len
,
buflen
-
len
);
len
+=
hostapd_get_sta_info
(
hapd
,
sta
,
buf
+
len
,
buflen
-
len
);
#ifdef CONFIG_SAE
if
(
sta
->
sae
&&
sta
->
sae
->
state
==
SAE_ACCEPTED
)
{
...
...
contrib/wpa/src/ap/dhcp_snoop.c
View file @
266f97b5
...
...
@@ -88,6 +88,7 @@ static void handle_dhcp(void *ctx, const u8 *src_addr, const u8 *buf,
}
}
#ifdef CONFIG_HS20
if
(
hapd
->
conf
->
disable_dgaf
&&
is_broadcast_ether_addr
(
buf
))
{
for
(
sta
=
hapd
->
sta_list
;
sta
;
sta
=
sta
->
next
)
{
if
(
!
(
sta
->
flags
&
WLAN_STA_AUTHORIZED
))
...
...
@@ -96,6 +97,7 @@ static void handle_dhcp(void *ctx, const u8 *src_addr, const u8 *buf,
(
u8
*
)
buf
,
len
);
}
}
#endif
/* CONFIG_HS20 */
if
(
msgtype
==
DHCPACK
)
{
if
(
b
->
your_ip
==
0
)
...
...
contrib/wpa/src/ap/dpp_hostapd.c
View file @
266f97b5
...
...
@@ -2276,6 +2276,8 @@ void hostapd_dpp_deinit(struct hostapd_data *hapd)
eloop_cancel_timeout
(
hostapd_dpp_conn_status_result_wait_timeout
,
hapd
,
NULL
);
hostapd_dpp_chirp_stop
(
hapd
);
if
(
hapd
->
iface
->
interfaces
)
dpp_controller_stop_for_ctx
(
hapd
->
iface
->
interfaces
->
dpp
,
hapd
);
#endif
/* CONFIG_DPP2 */
dpp_auth_deinit
(
hapd
->
dpp_auth
);
hapd
->
dpp_auth
=
NULL
;
...
...
@@ -2387,6 +2389,7 @@ hostapd_dpp_chirp_scan_res_handler(struct hostapd_iface *iface)
unsigned
int
i
;
struct
hostapd_hw_modes
*
mode
;
int
c
;
bool
chan6
=
hapd
->
iface
->
hw_features
==
NULL
;
if
(
!
bi
)
return
;
...
...
@@ -2406,7 +2409,21 @@ hostapd_dpp_chirp_scan_res_handler(struct hostapd_iface *iface)
}
/* Preferred chirping channels */
int_array_add_unique
(
&
hapd
->
dpp_chirp_freqs
,
2437
);
mode
=
dpp_get_mode
(
hapd
,
HOSTAPD_MODE_IEEE80211G
);
if
(
mode
)
{
for
(
c
=
0
;
c
<
mode
->
num_channels
;
c
++
)
{
struct
hostapd_channel_data
*
chan
=
&
mode
->
channels
[
c
];
if
(
chan
->
flag
&
(
HOSTAPD_CHAN_DISABLED
|
HOSTAPD_CHAN_RADAR
)
||
chan
->
freq
!=
2437
)
continue
;
chan6
=
true
;
break
;
}
}
if
(
chan6
)
int_array_add_unique
(
&
hapd
->
dpp_chirp_freqs
,
2437
);
mode
=
dpp_get_mode
(
hapd
,
HOSTAPD_MODE_IEEE80211A
);
if
(
mode
)
{
...
...
contrib/wpa/src/ap/hostapd.h