Skip to content

Commit

Permalink
network.device.ifname should point to @logical_name to avoid race con…
Browse files Browse the repository at this point in the history
…ditions on boot just for wlan interfaces
  • Loading branch information
G10h4ck committed Nov 9, 2014
1 parent b7cf9e8 commit bb920a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/lime-system/files/usr/lib/lua/lime/network.lua
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,15 @@ function network.createVlanIface(linuxBaseIfname, vid, openwrtNameSuffix, vlanPr
--! Do not use . as separator as this will make netifd create an 802.1q interface anyway
--! and sanitize linuxBaseIfName because it can contain dots as well (i.e. switch ports)
local linux802adIfName = linuxBaseIfname:gsub("[^%w_]", "_")..network.protoVlanSeparator..vlanId
local ifname = linuxBaseIfname
if string.sub(linuxBaseIfname, 1, 4) == "wlan" then ifname = "@"..network.limeIfNamePrefix..linuxBaseIfname end

local uci = libuci:cursor()

uci:set("network", owrtDeviceName, "device")
uci:set("network", owrtDeviceName, "type", vlanProtocol)
uci:set("network", owrtDeviceName, "name", linux802adIfName)
uci:set("network", owrtDeviceName, "ifname", "@"..network.limeIfNamePrefix..linuxBaseIfname)
uci:set("network", owrtDeviceName, "ifname", ifname)
uci:set("network", owrtDeviceName, "vid", vlanId)

uci:set("network", owrtInterfaceName, "interface")
Expand Down

0 comments on commit bb920a3

Please sign in to comment.