summaryrefslogtreecommitdiff
path: root/pkg/vpn/openvpn.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-10-08 11:55:15 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-10-08 11:55:57 +0200
commit71821ce8806a33158d4bb870ceb9f621008d3565 (patch)
tree71c2833f4a09f5ad882433d6a84d50b1b2bdb46a /pkg/vpn/openvpn.go
parentee2cda435f209df2a5ce647a36f51bc7011c6bdf (diff)
[feat] pass udp flag to bitmask-root
Diffstat (limited to 'pkg/vpn/openvpn.go')
-rw-r--r--pkg/vpn/openvpn.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/vpn/openvpn.go b/pkg/vpn/openvpn.go
index e2695a3..673dc2c 100644
--- a/pkg/vpn/openvpn.go
+++ b/pkg/vpn/openvpn.go
@@ -145,6 +145,7 @@ func (b *Bitmask) startOpenVPN() error {
}
proxyArgs := strings.Split(proxy, ":")
+ // TODO pass UDP flag
arg = append(arg, "--remote", proxyArgs[0], proxyArgs[1], "tcp4")
arg = append(arg, "--route", gw.IPAddress, "255.255.255.255", "net_gateway")
} else {
@@ -162,9 +163,11 @@ func (b *Bitmask) startOpenVPN() error {
for _, gw := range gateways {
for _, port := range gw.Ports {
if port != "53" {
- if os.Getenv("UDP") == "1" {
+ if b.udp {
+ os.Setenv("UDP", "1")
arg = append(arg, "--remote", gw.IPAddress, port, "udp4")
} else {
+ os.Setenv("UDP", "0")
arg = append(arg, "--remote", gw.IPAddress, port, "tcp4")
}
}