Skip to content

Commit

Permalink
lime-system: Avoid rawswitch usage if switch_vlan exists
Browse files Browse the repository at this point in the history
  • Loading branch information
G10h4ck committed Dec 25, 2014
1 parent 93bcd54 commit d73a0a7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/lime-system/files/usr/lib/lua/lime/network.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,16 @@ function network.scandevices()
--! Scan for plain ethernet interfaces and switch_vlan interfaces
local stdOut = io.popen("ls -1 /sys/class/net/")
for dev in stdOut:lines() do
if (dev:match("^eth%d+$") or dev:match("^eth%d+%.%d+$")) then
table.insert(devices, dev)
if dev:match("^eth%d+$") then
local insert = true
for d,_ in pairs(devices) do if d:match("^"..dev..".%d+$") then insert = false ; break; end end
if insert then devices[dev] = dev end
end

if dev:match("^eth%d+%.%d+$") then
local rawif = dev:match("^eth%d+")
devices[rawif] = nil
devices[dev] = dev
end
end
stdOut:close()
Expand Down

0 comments on commit d73a0a7

Please sign in to comment.