Changeset 45575


Ignore:
Timestamp:
2015-04-24T09:47:25+02:00 (3 years ago)
Author:
rmilecki
Message:

bcm53xx: sort ports from NVRAM entries before matching them

Some devices have unsorted ports which may lead to broken config.

Signed-off-by: Rafał Miłecki <zajec5@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/bcm53xx/base-files/etc/board.d/02_network

    r45458 r45575  
    1313ucidef_add_switch "switch0" "1" "1" 
    1414 
    15 vlan1ports="$(nvram get vlan1ports)" 
    16 vlan2ports="$(nvram get vlan2ports)" 
     15# NVRAM entries may contain unsorted ports, e.g. Netgear R6250 uses 
     16# vlan1ports=3 2 1 0 5* 
     17# vlan2ports=4 5u 
     18# and early Netgear R8000 was using 
     19# vlan1ports=3 2 1 0 5 7 8* 
     20vlan1ports="$(echo $(nvram get vlan1ports | tr " " "\n" | sort))" 
     21vlan2ports="$(echo $(nvram get vlan2ports | tr " " "\n" | sort))" 
    1722if echo "$vlan1ports" | egrep -q "^1 2 3 4 5" && \ 
    1823   echo "$vlan2ports" | egrep -q "^0 5"; then 
     
    2429        ucidef_add_switch_vlan "switch0" "2" "4 8t" 
    2530else 
    26         # This also handles some funcy (e.g. R6250) configs like: 
    27         # vlan1ports=3 2 1 0 5* 
    28         # vlan2ports=4 5u 
    2931        ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t" 
    3032        ucidef_add_switch_vlan "switch0" "2" "4 5t" 
Note: See TracChangeset for help on using the changeset viewer.