mesh: Add no_auto_peer config option
Add no_auto_peer parameter, which controls wheter a station will automatically initiate peering to another mesh peer that comes into range. Signed-off-by: Javier Lopez <jlopex@gmail.com> Signed-off-by: Jason Mobarak <x@jason.mobarak.name> Signed-off-by: Thomas Pedersen <thomas@noack.us>
This commit is contained in:
parent
476e6bb68d
commit
07cb45ccb2
4 changed files with 18 additions and 0 deletions
|
@ -1732,6 +1732,7 @@ static const struct parse_data ssid_fields[] = {
|
||||||
#endif /* IEEE8021X_EAPOL */
|
#endif /* IEEE8021X_EAPOL */
|
||||||
#ifdef CONFIG_MESH
|
#ifdef CONFIG_MESH
|
||||||
{ INT_RANGE(mode, 0, 5) },
|
{ INT_RANGE(mode, 0, 5) },
|
||||||
|
{ INT_RANGE(no_auto_peer, 0, 1) },
|
||||||
#else /* CONFIG_MESH */
|
#else /* CONFIG_MESH */
|
||||||
{ INT_RANGE(mode, 0, 4) },
|
{ INT_RANGE(mode, 0, 4) },
|
||||||
#endif /* CONFIG_MESH */
|
#endif /* CONFIG_MESH */
|
||||||
|
|
|
@ -669,6 +669,14 @@ struct wpa_ssid {
|
||||||
* followed).
|
* followed).
|
||||||
*/
|
*/
|
||||||
int mac_addr;
|
int mac_addr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* no_auto_peer - Do not automatically peer with compatible mesh peers
|
||||||
|
*
|
||||||
|
* When unset, the reception of a beacon from a another mesh peer in
|
||||||
|
* this MBSS will trigger a peering attempt.
|
||||||
|
*/
|
||||||
|
int no_auto_peer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* CONFIG_SSID_H */
|
#endif /* CONFIG_SSID_H */
|
||||||
|
|
|
@ -2610,6 +2610,8 @@ static int wpa_supplicant_ctrl_iface_update_network(
|
||||||
wpa_config_update_psk(ssid);
|
wpa_config_update_psk(ssid);
|
||||||
else if (os_strcmp(name, "priority") == 0)
|
else if (os_strcmp(name, "priority") == 0)
|
||||||
wpa_config_update_prio_list(wpa_s->conf);
|
wpa_config_update_prio_list(wpa_s->conf);
|
||||||
|
else if (os_strcmp(name, "no_auto_peer") == 0)
|
||||||
|
ssid->no_auto_peer = atoi(value);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -490,6 +490,7 @@ void wpa_mesh_new_mesh_peer(struct wpa_supplicant *wpa_s, const u8 *addr,
|
||||||
struct mesh_conf *conf = wpa_s->ifmsh->mconf;
|
struct mesh_conf *conf = wpa_s->ifmsh->mconf;
|
||||||
struct hostapd_data *data = wpa_s->ifmsh->bss[0];
|
struct hostapd_data *data = wpa_s->ifmsh->bss[0];
|
||||||
struct sta_info *sta;
|
struct sta_info *sta;
|
||||||
|
struct wpa_ssid *ssid = wpa_s->current_ssid;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
sta = ap_get_sta(data, addr);
|
sta = ap_get_sta(data, addr);
|
||||||
|
@ -532,6 +533,12 @@ void wpa_mesh_new_mesh_peer(struct wpa_supplicant *wpa_s, const u8 *addr,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ssid && ssid->no_auto_peer) {
|
||||||
|
wpa_msg(wpa_s, MSG_INFO, "will not initiate new peer link with "
|
||||||
|
MACSTR " because of no_auto_peer", MAC2STR(addr));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mesh_mpm_plink_open(wpa_s, sta, PLINK_OPEN_SENT);
|
mesh_mpm_plink_open(wpa_s, sta, PLINK_OPEN_SENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue