Skip to content
Snippets Groups Projects
Commit ddf7f4d0 authored by jkito's avatar jkito :skull: Committed by jkito
Browse files

Remove re-creation of 'gateways' var in 'startOpenvpn'

this fixes a bug where StartFirewall is called with an empty
'gateways' slice leading to blocking outgoing connections to
the openvpn gateway

in startOpenvpn func's global scope there's a 'gateways' var
which is passed to FirewallStart and the gateways are  added
to the firewall's allow list of IPs, this was re-declared in
the code branch for non-private bridge which is out of scope
where FirewallStart is called, leading to an empty 'gateways'
slice being passed to it
parent dbe62fd1
Branches
Tags
1 merge request!218Update to latest `obfsvpn`
......@@ -183,6 +183,7 @@ func (b *Bitmask) startOpenVPN(ctx context.Context) error {
var gw bonafide.Gateway
var gateways []bonafide.Gateway
var proxy string
var err error
gw, gotPrivate := maybeGetPrivateGateway()
if gotPrivate {
......@@ -202,7 +203,7 @@ func (b *Bitmask) startOpenVPN(ctx context.Context) error {
log.Debug().Msg("Getting a gateway with obfs4 transport...")
gateways, err := b.api.GetBestGateways("obfs4")
gateways, err = b.api.GetBestGateways("obfs4")
if err != nil {
return err
}
......@@ -224,7 +225,7 @@ func (b *Bitmask) startOpenVPN(ctx context.Context) error {
}
}
err := b.launch.FirewallStart(gateways)
err = b.launch.FirewallStart(gateways)
if err != nil {
return err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment