diff options
author | Cecylia Bocovich <cohosh@torproject.org> | 2020-11-18 15:40:32 -0500 |
---|---|---|
committer | Cecylia Bocovich <cohosh@torproject.org> | 2020-11-18 15:40:32 -0500 |
commit | 0bed9c48b7a3f59c7141e9934a44e73e03096faf (patch) | |
tree | 5ee568c6e2353c29617fa9e03a5d37245332509f | |
parent | 61beb9d996527cd8cb9e4ca650f8cbf24df1503e (diff) | |
download | snowflake-0bed9c48b7a3f59c7141e9934a44e73e03096faf.tar.gz snowflake-0bed9c48b7a3f59c7141e9934a44e73e03096faf.zip |
Redefine only symmetric NATs as restricted
-rw-r--r-- | common/nat/nat.go | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/common/nat/nat.go b/common/nat/nat.go index c9f16ad..4f2780c 100644 --- a/common/nat/nat.go +++ b/common/nat/nat.go @@ -16,10 +16,11 @@ package nat import ( "errors" "fmt" - "github.com/pion/stun" "log" "net" "time" + + "github.com/pion/stun" ) var ErrTimedOut = errors.New("timed out waiting for response") @@ -36,16 +37,7 @@ const ( // and false if the NAT is unrestrictive (meaning it // will work with most other NATs), func CheckIfRestrictedNAT(server string) (bool, error) { - result, err := isRestrictedMapping(server) - if err != nil { - return false, err - } - if !result { - // if the mapping is unrestrictive, we still need to check whether - // the filtering is restrictive - result, err = isRestrictedFiltering(server) - } - return result, err + return isRestrictedMapping(server) } // Performs two tests from RFC 5780 to determine whether the mapping type |