From 86ef9b0e97ff77f33d83775562f8f72e6b2a3cd5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 14 May 2016 00:15:23 +0200 Subject: [PATCH] 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: c73a12e0ea9fd6bb48927f0a03367354b5897ddc --- .../files/lib/gluon/upgrade/320-gluon-client-bridge-wireless | 2 +- .../lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless b/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless index 6fc8a72a..3edb39d8 100755 --- a/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless +++ b/package/gluon-client-bridge/files/lib/gluon/upgrade/320-gluon-client-bridge-wireless @@ -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, diff --git a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless index 05462c6f..dd3354de 100755 --- a/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless +++ b/package/gluon-mesh-batman-adv-core/files/lib/gluon/upgrade/320-gluon-mesh-batman-adv-core-wireless @@ -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,