diff --git a/package/gluon-mesh-vpn-fastd/check_site.lua b/package/gluon-mesh-vpn-fastd/check_site.lua index 57cc7bb1..6f3c0832 100644 --- a/package/gluon-mesh-vpn-fastd/check_site.lua +++ b/package/gluon-mesh-vpn-fastd/check_site.lua @@ -1,4 +1,4 @@ -local fastd_methods = {'salsa2012+umac', 'null+salsa2012+umac', 'null'} +local fastd_methods = {'salsa2012+umac', 'null+salsa2012+umac', 'null@l2tp', 'null'} need_array_of({'mesh_vpn', 'fastd', 'methods'}, fastd_methods) need_boolean(in_site({'mesh_vpn', 'fastd', 'configurable'}), false) diff --git a/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd b/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd index 5fed1e8c..1af8218e 100755 --- a/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd +++ b/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd @@ -17,20 +17,22 @@ end local methods if site.mesh_vpn.fastd.configurable(false) then - local has_null = util.contains(site.mesh_vpn.fastd.methods(), 'null') + local site_methods = site.mesh_vpn.fastd.methods() + local has_null = util.contains(site_methods, 'null@l2tp') or util.contains(site_methods, 'null') local old_methods = uci:get('fastd', 'mesh_vpn', 'method') if old_methods then - has_null = util.contains(old_methods, 'null') + has_null = util.contains(old_methods, 'null@l2tp') or util.contains(old_methods, 'null') end methods = {} if has_null then + table.insert(methods, 'null@l2tp') table.insert(methods, 'null') end - for _, method in ipairs(site.mesh_vpn.fastd.methods()) do - if method ~= 'null' then + for _, method in ipairs(site_methods) do + if method ~= 'null@l2tp' and method ~= 'null' then table.insert(methods, method) end end diff --git a/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua b/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua index ad890c31..9243ec92 100644 --- a/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua +++ b/package/gluon-web-mesh-vpn-fastd/luasrc/lib/gluon/config-mode/model/admin/mesh_vpn_fastd.lua @@ -10,7 +10,7 @@ mode.package = "gluon-web-mesh-vpn-fastd" mode.template = "mesh-vpn-fastd" local methods = uci:get('fastd', 'mesh_vpn', 'method') -if util.contains(methods, 'null') then +if util.contains(methods, 'null@l2tp') or util.contains(methods, 'null') then -- performance mode will only be used as default, if it is present in site.mesh_vpn.fastd.methods mode.default = 'performance' else @@ -24,11 +24,12 @@ function mode:write(data) -- if performance mode was selected, and the method 'null' was not present in the original table, it will be added local site_methods = {} if data == 'performance' then + table.insert(site_methods, 'null@l2tp') table.insert(site_methods, 'null') end for _, method in ipairs(site.mesh_vpn.fastd.methods()) do - if method ~= 'null' then + if method ~= 'null@l2tp' and method ~= 'null' then table.insert(site_methods, method) end end