+ local ip = client:getpeername()
+ local srv
+ luci.model.uci.foreach("network", "interface",
+ function (section)
+ if section.ipaddr then
+ local p = luci.sys.net.mask4prefix(section.netmask)
+ if luci.sys.net.belongs(ip, section.ipaddr, p) then
+ srv = section.ipaddr
+ return
+ end
+ end
+ end)
+