luci-mod-network: fix tagging/pvid state parsing in bridge-vlan ports
The previous code naively looked for a `t` in the entire port spec, wrongly matching untagged ports having a `t` in their name, such as `eth0`. Rework the logic to be more strict when parsing the port member specification to avoid this issue. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
e8a6f0bb7c
commit
01eac366f6
1 changed files with 13 additions and 8 deletions
|
@ -264,15 +264,20 @@ var cbiTagValue = form.Value.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
cfgvalue: function(section_id) {
|
cfgvalue: function(section_id) {
|
||||||
var pname = this.port,
|
var ports = L.toArray(uci.get('network', section_id, 'ports'));
|
||||||
spec = L.toArray(uci.get('network', section_id, 'ports')).filter(function(p) { return p.replace(/:[ut*]+$/, '') == pname })[0];
|
|
||||||
|
|
||||||
if (spec && spec.match(/t/))
|
for (var i = 0; i < ports.length; i++) {
|
||||||
return spec.match(/\*/) ? ['t', '*'] : ['t'];
|
var s = ports[i].split(/:/);
|
||||||
else if (spec)
|
|
||||||
return spec.match(/\*/) ? ['u', '*'] : ['u'];
|
if (s[0] != this.port)
|
||||||
else
|
continue;
|
||||||
return ['-'];
|
|
||||||
|
var t = s[1].match(/t/) ? 't' : 'u';
|
||||||
|
|
||||||
|
return s[1].match(/\*/) ? [t, '*'] : [t];
|
||||||
|
}
|
||||||
|
|
||||||
|
return ['-'];
|
||||||
},
|
},
|
||||||
|
|
||||||
write: function(section_id, value) {
|
write: function(section_id, value) {
|
||||||
|
|
Loading…
Reference in a new issue