Skip to content

Commit

Permalink
remove bogons
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Oct 16, 2024
1 parent 1bdabbb commit 8ca92e1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions internal/experiment/openvpn/richerinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package openvpn

import (
"context"
"fmt"
"slices"
"time"

"github.com/ooni/probe-cli/v3/internal/experimentconfig"
"github.com/ooni/probe-cli/v3/internal/legacy/netx"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/targetloading"
)

Expand Down Expand Up @@ -147,13 +147,19 @@ func (tl *targetLoader) loadFromDefaultEndpoints() ([]model.ExperimentTarget, er
}
}

fmt.Println(">>> ADDRS", addrs)
// Remove the bogons

// TODO: filter bogons (here), return err if nil
validAddrs := []string{}

for _, addr := range addrs {
if !netxlite.IsBogon(addr) {
validAddrs = append(validAddrs, addr)
}
}

tl.loader.Logger.Warnf("Picking from default OpenVPN endpoints")
targets := []model.ExperimentTarget{}
if inputs, err := pickOONIOpenVPNTargets(addrs); err == nil {
if inputs, err := pickOONIOpenVPNTargets(validAddrs); err == nil {
for _, url := range inputs {
targets = append(targets,
&Target{
Expand Down

0 comments on commit 8ca92e1

Please sign in to comment.