summaryrefslogtreecommitdiff
path: root/pkg/bitmask
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/bitmask
parentaae8c839c62ea39adc16ee844f59b90264b6aab1 (diff)
[bug] initialize bitmask with persisted udp option
Diffstat (limited to 'pkg/bitmask')
-rw-r--r--pkg/bitmask/init.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/bitmask/init.go b/pkg/bitmask/init.go
index bc7d47d..a03a64b 100644
--- a/pkg/bitmask/init.go
+++ b/pkg/bitmask/init.go
@@ -95,6 +95,11 @@ func InitializeBitmask(conf *config.Config) (Bitmask, error) {
return nil, err
}
+ err = setUDP(b, conf)
+ if err != nil {
+ return nil, err
+ }
+
if !conf.SkipLaunch {
err := maybeStartVPN(b, conf)
if err != nil {
@@ -119,6 +124,18 @@ func setTransport(b Bitmask, conf *config.Config) error {
return nil
}
+func setUDP(b Bitmask, conf *config.Config) error {
+ if conf.UDP {
+ log.Printf("Use UDP")
+ err := b.UseUDP(true)
+ if err != nil {
+ log.Printf("Error setting UDP: %v", err)
+ return err
+ }
+ }
+ return nil
+}
+
func maybeStartVPN(b Bitmask, conf *config.Config) error {
if !conf.StartVPN {
return nil