hostapd: adjust patches to work with git am
[openwrt/staging/xback.git] / package / network / services / hostapd / patches / 730-ft_iface.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 4 Jun 2021 09:12:07 +0200
3 Subject: [PATCH] hostapd: configure inter-AP communication interface for
4 802.11r
5
6 In setups using VLAN bridge filtering, hostapd may need to communicate using
7 a VLAN interface on top of the bridge, instead of using the bridge directly
8
9 --- a/hostapd/config_file.c
10 +++ b/hostapd/config_file.c
11 @@ -3200,6 +3200,8 @@ static int hostapd_config_fill(struct ho
12 wpa_printf(MSG_INFO,
13 "Line %d: Obsolete peerkey parameter ignored", line);
14 #ifdef CONFIG_IEEE80211R_AP
15 + } else if (os_strcmp(buf, "ft_iface") == 0) {
16 + os_strlcpy(bss->ft_iface, pos, sizeof(bss->ft_iface));
17 } else if (os_strcmp(buf, "mobility_domain") == 0) {
18 if (os_strlen(pos) != 2 * MOBILITY_DOMAIN_ID_LEN ||
19 hexstr2bin(pos, bss->mobility_domain,
20 --- a/src/ap/ap_config.h
21 +++ b/src/ap/ap_config.h
22 @@ -283,6 +283,7 @@ struct airtime_sta_weight {
23 struct hostapd_bss_config {
24 char iface[IFNAMSIZ + 1];
25 char bridge[IFNAMSIZ + 1];
26 + char ft_iface[IFNAMSIZ + 1];
27 char vlan_bridge[IFNAMSIZ + 1];
28 char wds_bridge[IFNAMSIZ + 1];
29 int bridge_hairpin; /* hairpin_mode on bridge members */
30 --- a/src/ap/wpa_auth_glue.c
31 +++ b/src/ap/wpa_auth_glue.c
32 @@ -1777,8 +1777,12 @@ int hostapd_setup_wpa(struct hostapd_dat
33 wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) {
34 const char *ft_iface;
35
36 - ft_iface = hapd->conf->bridge[0] ? hapd->conf->bridge :
37 - hapd->conf->iface;
38 + if (hapd->conf->ft_iface[0])
39 + ft_iface = hapd->conf->ft_iface;
40 + else if (hapd->conf->bridge[0])
41 + ft_iface = hapd->conf->bridge;
42 + else
43 + ft_iface = hapd->conf->iface;
44 hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB,
45 hostapd_rrb_receive, hapd, 1);
46 if (!hapd->l2) {