Skip to content

Commit

Permalink
lime-system: network.scandevices() filter out just proto vlans
Browse files Browse the repository at this point in the history
  • Loading branch information
G10h4ck authored and frank95 committed Aug 9, 2014
1 parent 15f9bae commit e9c8b1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/lime-system/files/usr/lib/lua/lime/network.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local utils = require("lime.utils")

network.limeIfNamePrefix="lm_"
network.protoParamsSeparator=":"
network.vlanSeparator="."
network.protoVlanSeparator="-"

function network.get_mac(ifname)
local mac = assert(fs.readfile("/sys/class/net/"..ifname.."/address")):gsub("\n","")
Expand Down Expand Up @@ -91,7 +91,7 @@ function network.scandevices()

-- Scan for plain ethernet interfaces
for _,dev in pairs(utils.split(io.popen("ls -1 /sys/class/net/"):read("*a"), "\n")) do
if dev:match("^eth%d$") then
if dev:match("^eth%d") and not dev:match(network.protoVlanSeparator.."%d$") then
table.insert(devices, dev)
end
end
Expand Down Expand Up @@ -151,7 +151,7 @@ function network.createVlanIface(linuxBaseIfname, vid, openwrtNameSuffix, vlanPr
local owrtInterfaceName = network.limeIfNamePrefix..linuxBaseIfname..openwrtNameSuffix.."_if"
local vlanId = vid
--! Do not use . as separator as this will make netifd create an 802.1q interface anyway
local linux802adIfName = linuxBaseIfname.."-"..vlanId
local linux802adIfName = linuxBaseIfname..network.protoVlanSeparator..vlanId

local uci = libuci:cursor()

Expand Down

0 comments on commit e9c8b1d

Please sign in to comment.