luci-olsr: fix snr calc olsr neighbours and unit in Legend
[project/luci.git] / applications / luci-olsr / luasrc / controller / olsr.lua
index daedcf5..cdd5645 100644 (file)
@@ -227,9 +227,9 @@ function action_neigh(json)
                                for assocmac, assot in pairs(val.list) do
                                        assocmac = string.lower(assocmac or "")
                                        if rmac == assocmac then
-                                               signal = tonumber(assot.signal)*-1
-                                               noise = tonumber(assot.noise)*-1
-                                               snr = noise - signal
+                                               signal = tonumber(assot.signal)
+                                               noise = tonumber(assot.noise)
+                                               snr = (noise*-1) - (signal*-1)
                                        end
                                end
                        end