From c83446d51bdae85ed9c500ea32f05df3b5be035b Mon Sep 17 00:00:00 2001
From: cyBerta <cyberta@riseup.net>
Date: Tue, 25 Mar 2025 18:06:28 +0100
Subject: [PATCH] set running state only after the local listener at the port
 for the local openvpn connection has been established, fixes state handling
 in case the port to listen on is already bound

---
 client/client.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/client.go b/client/client.go
index 900c752..1ee2156 100644
--- a/client/client.go
+++ b/client/client.go
@@ -205,13 +205,13 @@ func (c *Client) Start() (_ bool, err error) {
 	}
 	c.obfs4Conns = []Obfs4Conn{*obfs4Conn}
 
-	c.updateState(running)
-
 	c.openvpnConn, err = c.createOpenvpnConnection()
 	if err != nil {
 		return false, err
 	}
 
+	c.updateState(running)
+
 	if c.hopEnabled {
 		go c.hop()
 	}
-- 
GitLab