[PATCH luci] luci-mod-network: use "ports" option for setting bridge ports

Rafał Miłecki zajec5 at gmail.com
Tue May 18 00:34:39 PDT 2021


On 17.05.2021 14:10, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal at milecki.pl>
> 
> netifd has been recently patched to use more accurate "ports" option
> instead of "ifname"
> 
> Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
> ---
>   .../htdocs/luci-static/resources/tools/network.js             | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
> index b4d941c60d..370617397b 100644
> --- a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
> +++ b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js
> @@ -499,7 +499,7 @@ return baseclass.extend({
>   		o.multiple = true;
>   		o.noaliases = true;
>   		o.nobridges = true;
> -		o.ucioption = 'ifname';
> +		o.ucioption = 'ports';
>   		o.write = o.remove = setIfActive;
>   		o.default = L.toArray(dev ? dev.getPorts() : null).filter(function(p) { return p.getType() != 'wifi' }).map(function(p) { return p.getName() });
>   		o.filter = function(section_id, device_name) {
> @@ -509,7 +509,7 @@ return baseclass.extend({
>   
>   			/* only show wifi networks which are already present in "option ifname" */
>   			if (choice_dev.getType() == 'wifi') {
> -				var ifnames = L.toArray(uci.get('network', section_id, 'ifname'));
> +				var ifnames = L.toArray(uci.get('network', section_id, 'ports'));
>   
>   				for (var i = 0; i < ifnames.length; i++)
>   					if (ifnames[i] == device_name)
> 

Missed bit:

diff --git a/htdocs/luci-static/resources/tools/network.js b/htdocs/luci-static/resources/tools/network.js
index b4d941c..64aa7b1 100644
--- a/htdocs/luci-static/resources/tools/network.js
+++ b/htdocs/luci-static/resources/tools/network.js
@@ -918,8 +918,8 @@ return baseclass.extend({

  		var seen_ports = {};

-		L.toArray(uci.get('network', s.section, 'ifname')).forEach(function(ifname) {
-			seen_ports[ifname] = true;
+		L.toArray(uci.get('network', s.section, 'ports')).forEach(function(port) {
+			seen_ports[port] = true;
  		});

  		uci.sections('network', 'bridge-vlan', function(bvs) {



More information about the openwrt-devel mailing list