Skip to content

Commit

Permalink
lime-proto-anygw: enforce anygw.configure is onetime
Browse files Browse the repository at this point in the history
  • Loading branch information
G10h4ck committed Jan 17, 2015
1 parent 7ea1725 commit 3ee0272
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions packages/lime-proto-anygw/src/anygw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ local libuci = require "uci"

anygw = {}

anygw.configured = false

function anygw.configure(args)
if anygw.configured then return end
anygw.configured = true

local ipv4, ipv6 = network.primary_address()

-- anygw macvlan interface
Expand Down
4 changes: 2 additions & 2 deletions packages/lime-proto-bmx6/src/bmx6.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ 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+"))
Expand All @@ -125,7 +125,7 @@ function bmx6.setup_interface(ifname, args)
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 3ee0272

Please sign in to comment.