geolocator: ensure MAC addreses are filert by uppercase matching
This commit is contained in:
parent
e8f1d22e2a
commit
df565f76b5
@ -33,7 +33,7 @@ local function exit(exc)
|
|||||||
if file_exsist(PID_PART) then
|
if file_exsist(PID_PART) then
|
||||||
os.remove(PID_PART)
|
os.remove(PID_PART)
|
||||||
end
|
end
|
||||||
os.exit(tonumber(exc))
|
os.exit(exc)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function table_contains(tbl, prefix)
|
local function table_contains(tbl, prefix)
|
||||||
@ -64,7 +64,8 @@ local function Get_geolocation_info()
|
|||||||
-- Get list of BSSID there should ignored
|
-- Get list of BSSID there should ignored
|
||||||
local blacklist_bssid = { }
|
local blacklist_bssid = { }
|
||||||
for _, bl_bssid in ipairs(uci:get(GLC, "settings", "blacklist")) do
|
for _, bl_bssid in ipairs(uci:get(GLC, "settings", "blacklist")) do
|
||||||
table.insert(blacklist_bssid,string.upper(bl_bssid))
|
-- Ensure rm colons and uppercase
|
||||||
|
table.insert(blacklist_bssid,string.upper(bl_bssid):gsub(":", ""))
|
||||||
end
|
end
|
||||||
|
|
||||||
local scaned_bssid = ""
|
local scaned_bssid = ""
|
||||||
@ -76,6 +77,8 @@ local function Get_geolocation_info()
|
|||||||
|
|
||||||
-- Get list of BSSID without blacklisted and redundancy entrys.
|
-- Get list of BSSID without blacklisted and redundancy entrys.
|
||||||
for _, net in ipairs(iw.scanlist(ifname) or { }) do
|
for _, net in ipairs(iw.scanlist(ifname) or { }) do
|
||||||
|
-- Ensure rm colons and uppercase
|
||||||
|
net.bssid = string.upper(net.bssid:gsub(":", ""))
|
||||||
if not uniq[net.bssid] and not table_contains(blacklist_bssid, net.bssid) then
|
if not uniq[net.bssid] and not table_contains(blacklist_bssid, net.bssid) then
|
||||||
scaned_bssid = scaned_bssid .. "," .. net.bssid
|
scaned_bssid = scaned_bssid .. "," .. net.bssid
|
||||||
uniq[net.bssid] = true
|
uniq[net.bssid] = true
|
||||||
|
Loading…
Reference in New Issue
Block a user