Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon
Commits
a50cce4e
Commit
a50cce4e
authored
9 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-mesh-vpn-fastd: make adding or removing the null method survive updates (if desired)
parent
b76e1a9e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package/gluon-mesh-vpn-fastd/check_site.lua
+1
-0
1 addition, 0 deletions
package/gluon-mesh-vpn-fastd/check_site.lua
package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd
+29
-1
29 additions, 1 deletion
...mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd
with
30 additions
and
1 deletion
package/gluon-mesh-vpn-fastd/check_site.lua
+
1
−
0
View file @
a50cce4e
need_string_array
(
'fastd_mesh_vpn.methods'
)
need_number
(
'fastd_mesh_vpn.mtu'
)
need_boolean
(
'fastd_mesh_vpn.enabled'
,
false
)
need_boolean
(
'fastd_mesh_vpn.configurable'
,
false
)
local
function
check_peer
(
prefix
)
...
...
This diff is collapsed.
Click to expand it.
package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/400-mesh-vpn-fastd
+
29
−
1
View file @
a50cce4e
...
...
@@ -5,6 +5,7 @@ local users = require 'gluon.users'
local
util
=
require
'gluon.util'
local
uci
=
require
(
'luci.model.uci'
).
cursor
()
local
lutil
=
require
'luci.util'
-- The previously used user is removed, we need root privileges to use the packet_mark option
...
...
@@ -20,6 +21,33 @@ if not enabled then
end
local
methods
if
site
.
fastd_mesh_vpn
.
configurable
then
local
has_null
=
lutil
.
contains
(
site
.
fastd_mesh_vpn
.
methods
,
'null'
)
local
old_methods
=
uci
:
get
(
'fastd'
,
'mesh_vpn'
,
'method'
)
if
old_methods
then
has_null
=
lutil
.
contains
(
old_methods
,
'null'
)
end
methods
=
{}
if
has_null
then
table.insert
(
methods
,
'null'
)
end
for
_
,
method
in
ipairs
(
site
.
fastd_mesh_vpn
.
methods
)
do
if
method
~=
'null'
then
table.insert
(
methods
,
method
)
end
end
else
methods
=
site
.
fastd_mesh_vpn
.
methods
end
uci
:
section
(
'fastd'
,
'fastd'
,
'mesh_vpn'
,
{
enabled
=
enabled
,
...
...
@@ -29,7 +57,7 @@ uci:section('fastd', 'fastd', 'mesh_vpn',
mode
=
'tap'
,
mtu
=
site
.
fastd_mesh_vpn
.
mtu
,
secure_handshakes
=
1
,
method
=
site
.
fastd_mesh_vpn
.
methods
,
method
=
methods
,
packet_mark
=
1
,
status_socket
=
'/var/run/fastd.mesh_vpn.socket'
,
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment