From c259c29d1d0bb6e75ade954d179027489494aa1b Mon Sep 17 00:00:00 2001 From: PolynomialDivision Date: Fri, 22 Dec 2017 18:08:05 +0100 Subject: [PATCH 1/2] fix client array --- src/storage/datastorage.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/storage/datastorage.c b/src/storage/datastorage.c index 5ec49f5..120d4d2 100644 --- a/src/storage/datastorage.c +++ b/src/storage/datastorage.c @@ -336,28 +336,10 @@ int client_array_go_next_help(char sort_order[], int i, client entry, case 'b': return mac_is_greater(entry.bssid_addr, next_entry.bssid_addr) && mac_is_equal(entry.client_addr, next_entry.client_addr); - break; - // client-mac case 'c': - return mac_is_greater(entry.client_addr, next_entry.client_addr); - break; - - // frequency - // mac is 5 ghz or 2.4 ghz? - // case 'f': - // return //entry.freq < next_entry.freq && - // entry.freq < 5000 && - // next_entry.freq >= 5000 && - // //entry.freq < 5 && - // mac_is_equal(entry.client_addr, next_entry.client_addr); - // break; - - // signal strength (RSSI) - //case 's': - // return entry.signal < next_entry.signal && - // mac_is_equal(entry.client_addr, next_entry.client_addr); - // break; + return mac_is_greater(entry.client_addr, next_entry.client_addr) && + mac_is_greater(entry.bssid_addr, next_entry.bssid_addr); default: return 0; From 3a127e990089d622e160bd0a7fd362b5b37f78e5 Mon Sep 17 00:00:00 2001 From: PolynomialDivision Date: Fri, 22 Dec 2017 18:15:03 +0100 Subject: [PATCH 2/2] fix client array insert function --- src/storage/datastorage.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/storage/datastorage.c b/src/storage/datastorage.c index 120d4d2..a7e3a3b 100644 --- a/src/storage/datastorage.c +++ b/src/storage/datastorage.c @@ -334,17 +334,15 @@ int client_array_go_next_help(char sort_order[], int i, client entry, switch (sort_order[i]) { // bssid-mac case 'b': - return mac_is_greater(entry.bssid_addr, next_entry.bssid_addr) && - mac_is_equal(entry.client_addr, next_entry.client_addr); + return mac_is_greater(entry.bssid_addr, next_entry.bssid_addr); // client-mac case 'c': return mac_is_greater(entry.client_addr, next_entry.client_addr) && - mac_is_greater(entry.bssid_addr, next_entry.bssid_addr); - + mac_is_equal(entry.bssid_addr, next_entry.bssid_addr); default: - return 0; break; } + return 0; } int client_array_go_next(char sort_order[], int i, client entry,