summaryrefslogtreecommitdiff
path: root/pkg/vpn/bonafide
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/vpn/bonafide')
-rw-r--r--pkg/vpn/bonafide/bonafide.go7
-rw-r--r--pkg/vpn/bonafide/gateways.go4
2 files changed, 11 insertions, 0 deletions
diff --git a/pkg/vpn/bonafide/bonafide.go b/pkg/vpn/bonafide/bonafide.go
index e0d9c9c..8387873 100644
--- a/pkg/vpn/bonafide/bonafide.go
+++ b/pkg/vpn/bonafide/bonafide.go
@@ -236,6 +236,13 @@ func (b *Bonafide) SetAutomaticGateway() {
b.gateways.setAutomaticChoice()
}
+func (b *Bonafide) IsManualLocation() bool {
+ if b.gateways == nil {
+ return false
+ }
+ return b.gateways.isManualLocation()
+}
+
func (b *Bonafide) GetGatewayByIP(ip string) (Gateway, error) {
return b.gateways.getGatewayByIP(ip)
}
diff --git a/pkg/vpn/bonafide/gateways.go b/pkg/vpn/bonafide/gateways.go
index 5474a2f..c848d77 100644
--- a/pkg/vpn/bonafide/gateways.go
+++ b/pkg/vpn/bonafide/gateways.go
@@ -164,6 +164,10 @@ func (p *gatewayPool) setUserChoice(city []byte) error {
return nil
}
+func (p *gatewayPool) isManualLocation() bool {
+ return len(p.userChoice) != 0
+}
+
/* set the recommended field from an ordered array. needs to be modified if menshen passed an array of Loads */
func (p *gatewayPool) setRecommendedGateways(hostnames []string) {
hosts := make([]string, 0)