diff options
author | Paul Donald <newtwen+github@gmail.com> | 2024-11-07 01:45:41 +0100 |
---|---|---|
committer | Paul Donald <newtwen+github@gmail.com> | 2024-11-07 01:45:41 +0100 |
commit | 1de73e16f525a5edc80954afda50db88b3cf96da (patch) | |
tree | 7bc0c8addf3a97460c60b9edb13c4f50ff187f8b /protocols | |
parent | 9ddbc1155566a3d0ebc4aef5a2b46b89b075b14e (diff) |
luci-proto-vxlan: fix tos write and load handlers
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan.js | 7 | ||||
-rw-r--r-- | protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan6.js | 7 |
2 files changed, 10 insertions, 4 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')); diff --git a/protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan6.js b/protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan6.js index 9f54d4c1b8..3bf6a50c6a 100644 --- a/protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan6.js +++ b/protocols/luci-proto-vxlan/htdocs/luci-static/resources/protocol/vxlan6.js @@ -157,10 +157,13 @@ return network.registerProtocol('vxlan6', { 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')); |