summaryrefslogtreecommitdiff
path: root/pkg/vpn/bonafide/bonafide.go
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-12-01 20:08:33 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-12-01 20:08:33 +0100
commit81bc89e89404761d2fd15093f7f7ad209784e36a (patch)
tree4b8142c3ac0fc623f9c93ffe804f83783d9e43c6 /pkg/vpn/bonafide/bonafide.go
parent4f41965d86ada73f6148f756eef5048dc614c8f3 (diff)
[bug] clean exit
Diffstat (limited to 'pkg/vpn/bonafide/bonafide.go')
-rw-r--r--pkg/vpn/bonafide/bonafide.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/pkg/vpn/bonafide/bonafide.go b/pkg/vpn/bonafide/bonafide.go
index 907bba5..7bce545 100644
--- a/pkg/vpn/bonafide/bonafide.go
+++ b/pkg/vpn/bonafide/bonafide.go
@@ -247,10 +247,15 @@ func (b *Bonafide) maybeInitializeEIP() error {
b.gateways = newGatewayPool(b.eip)
}
- // FIXME: let's update the menshen gateways every time we 'maybe initilize EIP'
- // in a future we might want to be more clever on when to do that
- // (when opening the locations tab in the UI, only on reconnects, ...)
- b.fetchGatewaysFromMenshen()
+ // XXX For now, we just initialize once per session.
+ // We might update the menshen gateways every time we 'maybe initilize EIP'
+ // We might also want to be more clever on when to do that
+ // (when opening the locations tab in the UI, only on reconnects, ...)
+ // or just periodically - but we need to modify menshen api to
+ // pass a location parameter.
+ if len(b.gateways.recommended) == 0 {
+ b.fetchGatewaysFromMenshen()
+ }
}
return nil
}