[LEDE-DEV] [PATCH 3/5] lantiq: pass MAC address to the ATM bridge helper

Mathias Kresin dev at kresin.me
Sun Jul 3 00:14:23 PDT 2016


Am 03.07.2016 um 08:31 schrieb John Crispin:
> Hi,
>
> On 02/07/2016 17:00, Mathias Kresin wrote:
>> Signed-off-by: Mathias Kresin <dev at kresin.me>
>> ---
>>   target/linux/lantiq/base-files/etc/board.d/02_network | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network
>> index c271e62..3bb4e6e 100755
>> --- a/target/linux/lantiq/base-files/etc/board.d/02_network
>> +++ b/target/linux/lantiq/base-files/etc/board.d/02_network
>> @@ -163,7 +163,7 @@ WBMR300)
>>   esac
>>
>>   if [ -n "$(ls /lib/modules/`uname -r`/ltq_atm*)" ]; then
>> -	ucidef_add_atm_bridge "$vpi" "$vci" "$encaps" "$payload"
>> +	ucidef_add_atm_bridge "$vpi" "$vci" "$encaps" "$payload" "$wan_mac"
>>   fi
>>
>>   if grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo; then
>> @@ -177,7 +177,7 @@ fi
>>   ucidef_set_interface_wan "$interface_wan" "pppoe"
>>
>>   [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan "$lan_mac"
>> -[ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan "$wan_mac"
>> +[ -n "$wan_mac" ] && [ "$interface_wan" != "nas0" ] && ucidef_set_interface_macaddr wan "$wan_mac"
>>
>
> this is a bit quirky and will break devices that can support atm/ptm or
> that have 2 atm interfaces. is there no better way to detect if this is
> a atm bridge ?
>
> 	John
>

This quirk is used to ensure that during creating the initial network 
configuration a MAC is only set for an atm bridge and never for the 
(resulting) nas0 device.

I may got the purpose of the file wrong. But to my understanding it is 
used to create the initial network config. The logic in the file as it 
is neither allows to create multiple atm bridges nor allows to enable 
atm & ptm at the same time.

The resulting default /e/c/network is nearly the same as before. Only 
the mac is moved for ATM only devices from the nas0 interface to atm 
bridge (and will be inherit via ATM bridge to the nas0 interface).

Furthermore, for xrx200 devices the MAC is now added to the atm bridge 
as well and will be used as soon as someone switches from the initial 
configured ptm to atm.

Therefore, at least with the generated default network config I don't 
see the mentioned problems.

Mathias



More information about the Lede-dev mailing list