Fix creation of IBSS interfaces on devices with two radios

Lua's tables are 1-based, so we must decrement the index by 1 to get the
desired MAC addresses. By not doing this, the second IBSS interface would
get the address with index 8, but only indices 0..7 are available.

Fixes: c73a12e0ea
This commit is contained in:
Matthias Schiffer 2016-05-14 00:15:23 +02:00
parent c05f28d1a3
commit 86ef9b0e97
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ local function configure_client(config, radio, index, suffix)
uci:delete('wireless', name)
macaddr = util.generate_mac(3*index)
macaddr = util.generate_mac(3*(index-1))
if config and macaddr then
uci:section('wireless', 'wifi-iface', name,

View File

@ -29,7 +29,7 @@ local function configure_ibss(config, radio, index, suffix, disabled)
uci:delete('network', name .. '_vlan')
uci:delete('wireless', name)
macaddr = util.generate_mac(3*index+2)
macaddr = util.generate_mac(3*(index-1)+2)
if config and macaddr then
if config.vlan then
@ -79,7 +79,7 @@ local function configure_mesh(config, radio, index, suffix, disabled)
uci:delete('network', name)
uci:delete('wireless', name)
macaddr = util.generate_mac(3*index+1)
macaddr = util.generate_mac(3*(index-1)+1)
if config and macaddr then
uci:section('network', 'interface', name,