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:
Jo-Philipp Wich 2021-06-01 14:35:31 +02:00
parent 1818ddcac3
commit 5bdb5fd697

View file

@ -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;
}; };