+ local function compare(a,b)
+ if a.proto == b.proto then
+ return a.linkCost < b.linkCost
+ else
+ return a.proto < b.proto
+ end
+ end
+
+ for k, v in ipairs(data) do
+ if resolve == "1" then
+ hostname = nixio.getnameinfo(v.remoteIP, nil, 100)
+ if hostname then
+ v.hostname = hostname
+ end
+ end
+ if defaultgw == v.remoteIP then
+ v.defaultgw = 1
+ end
+ end
+
+ table.sort(data, compare)
+ luci.template.render("status-olsr/neighbors", {links=data, has_v4=has_v4, has_v6=has_v6})