From ef683e13aaefebd9cd1f267d5339e1ef574c42d0 Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Fri, 8 Oct 2021 11:55:15 +0200 Subject: [feat] pass udp flag to bitmask-root --- pkg/vpn/openvpn.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/vpn/openvpn.go') 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") } } -- cgit v1.2.3