From 9f1807c2c053e3b57881d42ebf58ec26dfee1b1d Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Tue, 22 Jun 2021 17:57:29 +0200 Subject: [bug] populate gateways early on - Closes: #511 --- pkg/vpn/openvpn.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkg/vpn/openvpn.go') diff --git a/pkg/vpn/openvpn.go b/pkg/vpn/openvpn.go index 1a34c22..6682094 100644 --- a/pkg/vpn/openvpn.go +++ b/pkg/vpn/openvpn.go @@ -219,6 +219,15 @@ func (b *Bitmask) getCert() (certPath string, err error) { return certPath, err } +// Explicit call to GetGateways, to be able to fetch them all before starting the vpn +func (b *Bitmask) fetchGateways() { + log.Println("Fetching gateways...") + _, err := b.bonafide.GetAllGateways(b.transport) + if err != nil { + log.Println("ERROR Cannot fetch gateways") + } +} + // StopVPN or cancel func (b *Bitmask) StopVPN() error { err := b.launch.firewallStop() -- cgit v1.2.3