mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Redefine only symmetric NATs as restricted
This commit is contained in:
parent
61beb9d996
commit
0bed9c48b7
1 changed files with 3 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue