Skip to content

Commit

Permalink
Merge pull request #388 from ivpn/QA/v3.14.16
Browse files Browse the repository at this point in the history
v3.14.16
  • Loading branch information
stenya authored Jul 8, 2024
2 parents 6f83822 + a18130d commit ef57dd8
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 41 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

## Version 3.14.16 - 2024-07-08

[FIX] (Windows) Fixed issue with initializing Split-Tunnel when the main network interface is not initialized
[FIX] (Windows) Fixed issue with resuming OpenVPN connection when Inverse Split-Tunnel is active

[Download IVPN Client for Windows](https://repo.ivpn.net/windows/bin/IVPN-Client-v3.14.16.exe)
SHA256: 89bf718ff97a8df2fd9e2784af98480db9f77f5a43f902dd397d46f9ab2ac09e

## Version 3.14.14 - 2024-06-03

[IMPROVED] Updated the liboqs library to v0.10.0, incorporating the latest updates in Quantum-Resistant algorithms
Expand Down
2 changes: 1 addition & 1 deletion daemon/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"env": {},
"args": ["-debug_install_dir=${workspaceRoot}", "-logging"],
//"buildFlags": "-tags debug",
"buildFlags": "-buildvcs=false -tags debug -ldflags '-X github.com/ivpn/desktop-app/daemon/version._version=3.14.14'"
"buildFlags": "-buildvcs=false -tags debug -ldflags '-X github.com/ivpn/desktop-app/daemon/version._version=3.14.16'"
//"buildFlags": ""
//"buildFlags": "-tags nowifi"
}
Expand Down
1 change: 1 addition & 0 deletions daemon/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"cSpell.words": [
"evtlog",
"Liboqs",
"netinfo",
"prefs",
"serv"
],
Expand Down
2 changes: 1 addition & 1 deletion daemon/References/common/etc/servers.json

Large diffs are not rendered by default.

50 changes: 29 additions & 21 deletions daemon/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,26 +186,15 @@ func (s *Service) init() error {
go func() {
defer close(_ipStackInitializationWaiter) // ip stack initialized (or timeout)
log.Info("Waiting for IP stack initialization ...")
endTime := time.Now().Add(time.Minute * 2)
for {
ipv4, err4 := netinfo.GetOutboundIP(false)
ipv6, err6 := netinfo.GetOutboundIP(true)
if (!ipv4.IsUnspecified() && err4 == nil) || (!ipv6.IsUnspecified() && err6 == nil) {
log.Info("IP stack initializaed")

// Save IP addresses of the current outbound interface (can be used, for example, for Split-Tunneling)
ipInfo := s.GetVpnSessionInfo()
ipInfo.OutboundIPv4 = ipv4
ipInfo.OutboundIPv6 = ipv6
s.SetVpnSessionInfo(ipInfo)

return
}
if time.Now().After(endTime) {
log.Info("WARNING! Timeout waiting for IP stack initialization!")
return
}
time.Sleep(time.Millisecond * 200)
if outIpv4, outIPv6, err := WaitAndGetOutboundIPs(time.Minute * 2); err != nil {
log.Error(fmt.Errorf("IP stack initialization waiter error: %w", err))
} else {
log.Info("IP stack initialized")
// Save IP addresses of the current outbound interface (can be used, for example, for Split-Tunneling)
ipInfo := s.GetVpnSessionInfo()
ipInfo.OutboundIPv4 = outIpv4
ipInfo.OutboundIPv6 = outIPv6
s.SetVpnSessionInfo(ipInfo)
}
}()

Expand Down Expand Up @@ -326,11 +315,30 @@ func (s *Service) init() error {
}()

// Start processing power events in separate routine (Windows)
s.startProcessingPowerEvents()
go func() {
<-_ipStackInitializationWaiter // Wait for IP stack initialization
s.startProcessingPowerEvents()
}()

return nil
}

func WaitAndGetOutboundIPs(timeout time.Duration) (outIpv4, outIPv6 net.IP, err error) {
endTime := time.Now().Add(timeout)
var err4, err6 error
for {
outIpv4, err4 = netinfo.GetOutboundIP(false)
outIPv6, err6 = netinfo.GetOutboundIP(true)
if (!outIpv4.IsUnspecified() && err4 == nil) || (!outIPv6.IsUnspecified() && err6 == nil) {
return outIpv4, outIPv6, nil
}
if time.Now().After(endTime) {
return outIpv4, outIPv6, fmt.Errorf("timeout")
}
time.Sleep(time.Millisecond * 200)
}
}

// UnInitialise - function prepares to daemon stop (Stop/Disable everything)
// - disconnect VPN (if connected)
// - disable Split Tunnel mode
Expand Down
12 changes: 5 additions & 7 deletions daemon/service/service_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,13 +882,11 @@ func (s *Service) connect(originalEntryServerInfo *svrConnInfo, vpnProc vpn.Proc
// Split-Tunnelling: Checking default outbound IPs
// (note: it is important to call this code after 'vpnProc.Init()')
var sInfo VpnSessionInfo
sInfo.OutboundIPv4, err = netinfo.GetOutboundIP(false)
if err != nil {
log.Warning(fmt.Errorf("failed to detect outbound IPv4 address: %w", err))
}
sInfo.OutboundIPv6, err = netinfo.GetOutboundIP(true)
if err != nil {
log.Warning(fmt.Errorf("failed to detect outbound IPv6 address: %w", err))
log.Info("Detecting outbound IP addresses...")
if sInfo.OutboundIPv4, sInfo.OutboundIPv6, err = WaitAndGetOutboundIPs(time.Minute); err != nil {
log.Error(fmt.Errorf("failed to detect outbound IP addresses: %w", err))
} else {
log.Info(fmt.Sprintf("Detected outbound IP addresses: %v, %v", sInfo.OutboundIPv4, sInfo.OutboundIPv6))
}
s.SetVpnSessionInfo(sInfo)

Expand Down
11 changes: 11 additions & 0 deletions daemon/vpn/openvpn/openvpn.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"strconv"
"strings"
"sync"
"time"

"github.com/ivpn/desktop-app/daemon/logger"
"github.com/ivpn/desktop-app/daemon/obfsproxy"
Expand Down Expand Up @@ -527,6 +528,16 @@ func (o *OpenVPN) Pause() error {

// Resume doing required operation for Resume (restores DNS configuration before Pause)
func (o *OpenVPN) Resume() (retErr error) {
// If OpenVPN is in re-connecting state - wait until connected
defer func() {
for {
if !o.state.IsConnecting() {
break
}
time.Sleep(time.Millisecond * 100)
}
}()

o.pauseLocker.Lock()
defer o.pauseLocker.Unlock()

Expand Down
9 changes: 9 additions & 0 deletions daemon/vpn/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ const (
INITIALISED State = iota // Interface initialised (WireGuard: but connection handshake still not detected)
)

func (s State) IsConnecting() bool {
switch s {
case CONNECTING, WAIT, AUTH, GETCONFIG, ASSIGNIP, ADDROUTES, RECONNECTING, TCP_CONNECT:
return true
default:
return false
}
}

func (s State) String() string {
if s < DISCONNECTED || s > INITIALISED {
return "<Unknown>"
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
name: ivpn # you probably want to 'snapcraft register <name>'
base: core20 # the base snap is the execution environment for this snap
# TODO: Set 'version:' to the same value as in 'ui/package.json'. This value will be used to stamp version for CLI and daemon
version: "3.14.14"
version: "3.14.16"

title: IVPN
summary: IVPN - Secure VPN for Privacy # 79 char long summary
Expand Down
18 changes: 9 additions & 9 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ivpn-ui",
"version": "3.14.14",
"version": "3.14.16",
"productName": "IVPN",
"description": "IVPN Client",
"author": "IVPN Limited",
Expand Down

0 comments on commit ef57dd8

Please sign in to comment.