diff options
Diffstat (limited to 'protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan.js')
-rw-r--r-- | protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan.js b/protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan.js index 3997bc6277..358f1da2cb 100644 --- a/protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan.js +++ b/protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan.js @@ -157,10 +157,13 @@ return network.registerProtocol('vxlan', { return false; }; o.write = function(section_id, value) { - return uci.set('network', section_id, 'tos', parseInt(value).toString(16).padStart(2, '0')); + if (!value) return + value = value === 'inherit' ? value : parseInt(value).toString(16).padStart(2, '0'); + return uci.set('network', section_id, 'tos', value); }; o.load = function(section_id) { - return parseInt(uci.get('network', section_id, 'tos'), 16).toString(); + const value = uci.get('network', section_id, 'tos'); + return value ? (value === 'inherit' ? value : parseInt(value, 16).toString()) : null; }; o = s.taboption('advanced', form.Flag, 'rxcsum', _('Enable rx checksum')); |