luci-mod-network: don't accidentally reset macvlan device names
Fixes: #5081
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 671c94b034
)
This commit is contained in:
parent
1818ddcac3
commit
5bdb5fd697
1 changed files with 10 additions and 8 deletions
|
@ -423,6 +423,7 @@ return baseclass.extend({
|
||||||
o.default = (dev ? dev.getName() : '').match(/^.+\.\d+$/) ? dev.getName().replace(/\.\d+$/, '') : '';
|
o.default = (dev ? dev.getName() : '').match(/^.+\.\d+$/) ? dev.getName().replace(/\.\d+$/, '') : '';
|
||||||
o.ucioption = 'ifname';
|
o.ucioption = 'ifname';
|
||||||
o.validate = function(section_id, value) {
|
o.validate = function(section_id, value) {
|
||||||
|
if (isNew) {
|
||||||
var type = this.section.formvalue(section_id, 'type'),
|
var type = this.section.formvalue(section_id, 'type'),
|
||||||
name = this.section.getUIElement(section_id, 'name_complex');
|
name = this.section.getUIElement(section_id, 'name_complex');
|
||||||
|
|
||||||
|
@ -435,6 +436,7 @@ return baseclass.extend({
|
||||||
name.setValue('%smac%d'.format(value, i));
|
name.setValue('%smac%d'.format(value, i));
|
||||||
name.triggerValidation();
|
name.triggerValidation();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue