summaryrefslogtreecommitdiff
path: root/pkg/backend/init.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-11-30 21:14:44 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-11-30 21:22:48 +0100
commit9c2453b05a98bc5131c37c5dfb535f10bf1054f5 (patch)
treea6ffa3d2107f9eafb1d9a5643d34dcc432ccf46b /pkg/backend/init.go
parentaae8c839c62ea39adc16ee844f59b90264b6aab1 (diff)
[bug] initialize bitmask with persisted udp option
Diffstat (limited to 'pkg/backend/init.go')
-rw-r--r--pkg/backend/init.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/backend/init.go b/pkg/backend/init.go
index c6d713b..fae5ff1 100644
--- a/pkg/backend/init.go
+++ b/pkg/backend/init.go
@@ -58,6 +58,7 @@ func initializeBitmask(errCh chan string, opts *InitOpts) {
bitmask.InitializeLogger()
ctx.cfg = config.ParseConfig()
setConfigOpts(opts, ctx.cfg)
+ ctx.UseUDP = ctx.cfg.UDP
err := pid.AcquirePID()
if err != nil {
@@ -92,6 +93,7 @@ func initializeBitmask(errCh chan string, opts *InitOpts) {
ctx.IsReady = true
}
+// transfer initialization options from the config json to the config object
func setConfigOpts(opts *InitOpts, conf *config.Config) {
conf.SkipLaunch = opts.SkipLaunch
if opts.StartVPN != "" {
@@ -104,6 +106,9 @@ func setConfigOpts(opts *InitOpts, conf *config.Config) {
if opts.Obfs4 {
conf.Obfs4 = opts.Obfs4
}
+ if opts.UDP {
+ conf.UDP = opts.UDP
+ }
if opts.DisableAutostart {
conf.DisableAutostart = opts.DisableAutostart
}