summaryrefslogtreecommitdiff
path: root/pkg/vpn/openvpn.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-11-30 18:49:00 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-11-30 21:22:45 +0100
commit52206cc7dda3d12d92dad3181e27b680c70e69e3 (patch)
treea28f33a102f2d703a622b9f332e98c913e3d3095 /pkg/vpn/openvpn.go
parent0419a17814fba437e111d0335fb05a9806f9589f (diff)
[feat] udp nameservers
Diffstat (limited to 'pkg/vpn/openvpn.go')
-rw-r--r--pkg/vpn/openvpn.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/vpn/openvpn.go b/pkg/vpn/openvpn.go
index d4e6330..e110d45 100644
--- a/pkg/vpn/openvpn.go
+++ b/pkg/vpn/openvpn.go
@@ -155,6 +155,11 @@ func (b *Bitmask) startOpenVPN() error {
if err != nil {
return err
}
+ if b.udp {
+ os.Setenv("UDP", "1")
+ } else {
+ os.Setenv("UDP", "0")
+ }
err = b.launch.firewallStart(gateways)
if err != nil {
return err
@@ -164,10 +169,8 @@ func (b *Bitmask) startOpenVPN() error {
for _, port := range gw.Ports {
if port != "53" {
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")
}
}