From 9b523704bbc3c73764dfee81c5215e2c23641ba4 Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Fri, 22 Apr 2022 14:19:09 -0400 Subject: [PATCH] Enable acceptAggressiveNomination by default Always accept Aggressive Nominations by remote agent Relates to 18f7a214aae82a41a6d91a90a7652cf66e3e90e2 --- agent.go | 4 ---- agent_udpmux_test.go | 1 + candidate_relay_test.go | 1 + candidate_server_reflexive_test.go | 1 + connectivity_vnet_test.go | 1 + gather_test.go | 1 + gather_vnet_test.go | 1 + mdns_test.go | 1 + selection.go | 3 +-- transport_test.go | 1 + transport_vnet_test.go | 1 + udp_mux_test.go | 1 + udp_mux_universal_test.go | 1 + 13 files changed, 12 insertions(+), 6 deletions(-) diff --git a/agent.go b/agent.go index ebdd1d8..951103b 100644 --- a/agent.go +++ b/agent.go @@ -133,8 +133,6 @@ type Agent struct { insecureSkipVerify bool proxyDialer proxy.Dialer - - acceptAggressiveNomination bool } type task struct { @@ -316,8 +314,6 @@ func NewAgent(config *AgentConfig) (*Agent, error) { //nolint:gocognit interfaceFilter: config.InterfaceFilter, insecureSkipVerify: config.InsecureSkipVerify, - - acceptAggressiveNomination: config.AcceptAggressiveNomination, } a.tcpMux = config.TCPMux diff --git a/agent_udpmux_test.go b/agent_udpmux_test.go index 0aa430c..acfeb47 100644 --- a/agent_udpmux_test.go +++ b/agent_udpmux_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice diff --git a/candidate_relay_test.go b/candidate_relay_test.go index 9170a5c..d45b32b 100644 --- a/candidate_relay_test.go +++ b/candidate_relay_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice diff --git a/candidate_server_reflexive_test.go b/candidate_server_reflexive_test.go index 0d7a9cb..41306fa 100644 --- a/candidate_server_reflexive_test.go +++ b/candidate_server_reflexive_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice diff --git a/connectivity_vnet_test.go b/connectivity_vnet_test.go index cead71d..82272d3 100644 --- a/connectivity_vnet_test.go +++ b/connectivity_vnet_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice diff --git a/gather_test.go b/gather_test.go index 0e3ef24..b7c5ffa 100644 --- a/gather_test.go +++ b/gather_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice diff --git a/gather_vnet_test.go b/gather_vnet_test.go index 211cea4..fc3145a 100644 --- a/gather_vnet_test.go +++ b/gather_vnet_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice diff --git a/mdns_test.go b/mdns_test.go index cb13703..d56dcd7 100644 --- a/mdns_test.go +++ b/mdns_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice diff --git a/selection.go b/selection.go index 459d3ed..d87a389 100644 --- a/selection.go +++ b/selection.go @@ -252,8 +252,7 @@ func (s *controlledSelector) HandleBindingRequest(m *stun.Message, local, remote // previously sent by this pair produced a successful response and // generated a valid pair (Section 7.2.5.3.2). The agent sets the // nominated flag value of the valid pair to true. - if selectedPair := s.agent.getSelectedPair(); selectedPair == nil || - (s.agent.acceptAggressiveNomination && selectedPair.priority() < p.priority()) { + if selectedPair := s.agent.getSelectedPair(); selectedPair == nil || selectedPair.priority() < p.priority() { s.agent.setSelectedPair(p) } else if selectedPair != p { s.log.Tracef("ignore nominate new pair %s, already nominated pair %s", p, selectedPair) diff --git a/transport_test.go b/transport_test.go index a633e9f..90c90c4 100644 --- a/transport_test.go +++ b/transport_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice diff --git a/transport_vnet_test.go b/transport_vnet_test.go index 153c211..87b9541 100644 --- a/transport_vnet_test.go +++ b/transport_vnet_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice diff --git a/udp_mux_test.go b/udp_mux_test.go index 127f25f..649760e 100644 --- a/udp_mux_test.go +++ b/udp_mux_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice diff --git a/udp_mux_universal_test.go b/udp_mux_universal_test.go index 052eedb..2e1168f 100644 --- a/udp_mux_universal_test.go +++ b/udp_mux_universal_test.go @@ -1,3 +1,4 @@ +//go:build !js // +build !js package ice