Skip to content
Snippets Groups Projects
Unverified Commit 849af9ad authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-client-bridge, gluon-mesh-batman-adv-core: simplify VIF config functions

parent b2117fd3
Branches
Tags
No related merge requests found
......@@ -21,9 +21,15 @@ local function configure_client(config, radio, index, suffix)
uci:delete('wireless', name)
if not config then
return
end
macaddr = util.generate_mac(3*(index-1))
if not macaddr then
return
end
if config and macaddr then
uci:section('wireless', 'wifi-iface', name,
{
device = radio,
......@@ -36,7 +42,6 @@ local function configure_client(config, radio, index, suffix)
}
)
end
end
local function configure_radio(radio, index, config)
local suffix = radio:match('^radio(%d+)$')
......
......@@ -29,9 +29,15 @@ local function configure_ibss(config, radio, index, suffix, disabled)
uci:delete('network', name .. '_vlan')
uci:delete('wireless', name)
if not config then
return
end
macaddr = util.generate_mac(3*(index-1)+2)
if not macaddr then
return
end
if config and macaddr then
if config.vlan then
uci:section('network', 'interface', name,
{
......@@ -69,7 +75,6 @@ local function configure_ibss(config, radio, index, suffix, disabled)
}
)
end
end
local function configure_mesh(config, radio, index, suffix, disabled)
local name = 'mesh_' .. radio
......@@ -79,9 +84,15 @@ local function configure_mesh(config, radio, index, suffix, disabled)
uci:delete('network', name)
uci:delete('wireless', name)
if not config then
return
end
macaddr = util.generate_mac(3*(index-1)+1)
if not macaddr then
return
end
if config and macaddr then
uci:section('network', 'interface', name,
{
proto = 'batadv',
......@@ -105,7 +116,6 @@ local function configure_mesh(config, radio, index, suffix, disabled)
}
)
end
end
local function configure_radio(radio, index, config)
local suffix = radio:match('^radio(%d+)$')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment