mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
improvement: use SetIPFilter
for local addrs
Closes https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40271. Supersedes https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/417. This simplifies the code and (probably) removes the need for `StripLocalAddresses`, although makes us more dependent on Pion. Signed-off-by: Cecylia Bocovich <cohosh@torproject.org>
This commit is contained in:
parent
43799819a1
commit
ae5bd52821
6 changed files with 56 additions and 32 deletions
|
@ -74,6 +74,11 @@ func IsLocal(ip net.IP) bool {
|
|||
}
|
||||
|
||||
// Removes local LAN address ICE candidates
|
||||
//
|
||||
// This is unused after https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/442,
|
||||
// but come in handy later for https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40322
|
||||
// Also this is exported, so let's not remove it at least until
|
||||
// the next major release.
|
||||
func StripLocalAddresses(str string) string {
|
||||
var desc sdp.SessionDescription
|
||||
err := desc.Unmarshal([]byte(str))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue