Skip to content

Commit

Permalink
Workaround for iussue 38
Browse files Browse the repository at this point in the history
  • Loading branch information
G10h4ck committed Oct 28, 2014
1 parent 66bde2a commit e44b804
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/lime-proto-batadv/src/batadv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local libuci = require("uci")
local fs = require("nixio.fs")
local lan = require("lime.proto.lan")
local utils = require("lime.utils")
local wireless = require("lime.wireless")

batadv = {}

Expand Down
12 changes: 12 additions & 0 deletions packages/lime-proto-bmx6/src/bmx6.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local network = require("lime.network")
local config = require("lime.config")
local fs = require("nixio.fs")
local libuci = require("uci")
local wireless = require("lime.wireless")

bmx6 = {}

Expand All @@ -17,6 +18,17 @@ function bmx6.setup_interface(ifname, args)

local uci = libuci:cursor()
uci:set("network", owrtDeviceName, "mtu", "1398")

-- BEGIN [Workaround issue 38]
if ifname:match("^wlan%d+") then
local macAddr = wireless.get_phy_mac("phy"..ifname:match("%d+"))
local vlanIp = { 169, 254, tonumber(macAddr[5], 16), tonumber(macAddr[6], 16) }
uci:set("network", owrtInterfaceName, "proto", "static")
uci:set("network", owrtInterfaceName, "ipaddr", table.concat(vlanIp, "."))
uci:set("network", owrtInterfaceName, "netmask", "255.255.255.255")
end
--- END [Workaround issue 38]

uci:save("network")

uci:set("bmx6", owrtInterfaceName, "dev")
Expand Down

0 comments on commit e44b804

Please sign in to comment.