[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [snowflake/master] Redefine only symmetric NATs as restricted



commit 0bed9c48b7a3f59c7141e9934a44e73e03096faf
Author: Cecylia Bocovich <cohosh@xxxxxxxxxxxxxx>
Date:   Wed Nov 18 15:40:32 2020 -0500

    Redefine only symmetric NATs as restricted
---
 common/nat/nat.go | 14 +++-----------
 1 file 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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits