mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
Force client to reconnect if no prob for own entry
This commit is contained in:
parent
7ec3d7b43c
commit
de5fbef9d9
1 changed files with 13 additions and 3 deletions
|
@ -62,7 +62,7 @@ int eval_probe_metric(struct probe_entry_s probe_entry) {
|
||||||
|
|
||||||
int better_ap_available(uint8_t bssid_addr[], uint8_t client_addr[])
|
int better_ap_available(uint8_t bssid_addr[], uint8_t client_addr[])
|
||||||
{
|
{
|
||||||
int own_score = 0;
|
int own_score = -1;
|
||||||
|
|
||||||
// find first client entry in probe array
|
// find first client entry in probe array
|
||||||
int i;
|
int i;
|
||||||
|
@ -78,7 +78,8 @@ int better_ap_available(uint8_t bssid_addr[], uint8_t client_addr[])
|
||||||
if (!mac_is_equal(probe_array[j].client_addr, client_addr)) {
|
if (!mac_is_equal(probe_array[j].client_addr, client_addr)) {
|
||||||
// this shouldn't happen!
|
// this shouldn't happen!
|
||||||
//return 1; // kick client!
|
//return 1; // kick client!
|
||||||
return 0;
|
//return 0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (mac_is_equal(bssid_addr, probe_array[j].bssid_addr)) {
|
if (mac_is_equal(bssid_addr, probe_array[j].bssid_addr)) {
|
||||||
own_score = eval_probe_metric(probe_array[j]);
|
own_score = eval_probe_metric(probe_array[j]);
|
||||||
|
@ -86,6 +87,12 @@ int better_ap_available(uint8_t bssid_addr[], uint8_t client_addr[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// no entry for own ap
|
||||||
|
if(own_score == -1)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int k;
|
int k;
|
||||||
for (k = i; k <= probe_entry_last; k++) {
|
for (k = i; k <= probe_entry_last; k++) {
|
||||||
if (!mac_is_equal(probe_array[k].client_addr, client_addr)) {
|
if (!mac_is_equal(probe_array[k].client_addr, client_addr)) {
|
||||||
|
@ -122,10 +129,13 @@ void kick_clients(uint8_t bssid[], uint32_t id) {
|
||||||
if (!mac_is_equal(client_array[j].bssid_addr, bssid)) {
|
if (!mac_is_equal(client_array[j].bssid_addr, bssid)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (kick_client(client_array[j])) {
|
if (kick_client(client_array[j]) > 0) {
|
||||||
// TODO: Better debug output
|
// TODO: Better debug output
|
||||||
printf("KICKING CLIENT!!!!!!!!!!!!!\n");
|
printf("KICKING CLIENT!!!!!!!!!!!!!\n");
|
||||||
del_client_interface(id, client_array[j].client_addr, 5, 1, 60000);
|
del_client_interface(id, client_array[j].client_addr, 5, 1, 60000);
|
||||||
|
} else if (kick_client(client_array[j]) == -1) {
|
||||||
|
printf("Force client to reconnect!!!!!!!!!!!!!\n");
|
||||||
|
del_client_interface(id, client_array[j].client_addr, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
printf("STAAAY CLIENT!!!!!!!!!!!!!\n");
|
printf("STAAAY CLIENT!!!!!!!!!!!!!\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue