diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-10-08 11:55:15 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-10-08 11:55:57 +0200 |
commit | 71821ce8806a33158d4bb870ceb9f621008d3565 (patch) | |
tree | 71c2833f4a09f5ad882433d6a84d50b1b2bdb46a /pkg/vpn/openvpn.go | |
parent | ee2cda435f209df2a5ce647a36f51bc7011c6bdf (diff) |
[feat] pass udp flag to bitmask-root
Diffstat (limited to 'pkg/vpn/openvpn.go')
-rw-r--r-- | pkg/vpn/openvpn.go | 5 |
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") } } |