ucidef_add_switch_port_transparent() is pretty specific to the rt305x switch,
so I don't think it belongs into the base-files package.

Also the preferred change would be to make sure that enable_vlan = 0
works as expected instead of working around here.

Daniel Golle wrote:

> Signed-off-by: Daniel Golle <[email protected]>
> 
> diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
> b/package/base-files/files/lib/functions/uci-defaults.sh
> index 477c00c..dc49592 100644
> --- a/package/base-files/files/lib/functions/uci-defaults.sh
> +++ b/package/base-files/files/lib/functions/uci-defaults.sh
> @@ -228,3 +228,26 @@ set network.@switch_vlan[-1].ports='$ports'
>  EOF
>  }
>  
> +ucidef_add_switch_port_transparent() {
> +     local device=$1
> +     local port=$2
> +     uci batch <<EOF
> +add network switch_port
> +set network.@switch_port[-1].device='$device'
> +set network.@switch_port[-1].port='$port'
> +set network.@switch_port[-1].untag='1'
> +set network.@switch_port[-1].doubletag='1'
> +set network.@switch_port[-1].en_vlan='1'
> +EOF
> +}
> +
> +ucidef_add_switch_port_disable() {
> +     local device=$1
> +     local port=$2
> +     uci batch <<EOF
> +add network switch_port
> +set network.@switch_port[-1].device='$device'
> +set network.@switch_port[-1].port='$port'
> +set network.@switch_port[-1].disable='1'
> +EOF
> +}
> -- 
> 1.7.12
> 



-- 
Tobias                                          PGP: http://8ef7ddba.uguu.de
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to