From: Nick Hainke Date: Tue, 27 Sep 2022 07:30:15 +0000 (+0200) Subject: luci-app-dawn: return 0 in case of weird frequency X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=88bb5f31c44926170f2ff43adef91877f4af283b;p=openwrt-luci.git luci-app-dawn: return 0 in case of weird frequency Sometimes 0 is passed to the frequency. Return 0 in that case. Signed-off-by: Nick Hainke --- diff --git a/applications/luci-app-dawn/luasrc/tools/ieee80211.lua b/applications/luci-app-dawn/luasrc/tools/ieee80211.lua index b35991ed7d..44b0464427 100644 --- a/applications/luci-app-dawn/luasrc/tools/ieee80211.lua +++ b/applications/luci-app-dawn/luasrc/tools/ieee80211.lua @@ -1,7 +1,9 @@ module("luci.tools.ieee80211", package.seeall) function frequency_to_channel(freq) - if (freq == 2484) then + if (freq <= 2400) then + return 0; + elseif (freq == 2484) then return 14; elseif (freq < 2484) then return (freq - 2407) / 5;