Skip to content

Commit

Permalink
Unspecified address: default NetworkTypeUDP4+NetworkTypeUDP6
Browse files Browse the repository at this point in the history
  • Loading branch information
victorserbu2709 committed Oct 29, 2024
1 parent 10480eb commit 9915d47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/iface/bind/udp_mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@ func NewUDPMuxDefault(params UDPMuxParams) *UDPMuxDefault {
params.Logger.Warn("UDPMuxDefault should not listening on unspecified address, use NewMultiUDPMuxFromPort instead")
var networks []ice.NetworkType
switch {
case addr.IP.To4() != nil:
networks = []ice.NetworkType{ice.NetworkTypeUDP4}

case addr.IP.To16() != nil:
networks = []ice.NetworkType{ice.NetworkTypeUDP4, ice.NetworkTypeUDP6}

case addr.IP.To4() != nil:
networks = []ice.NetworkType{ice.NetworkTypeUDP4}

default:
params.Logger.Errorf("LocalAddr expected IPV4 or IPV6, got %T", params.UDPConn.LocalAddr())
}
Expand Down

0 comments on commit 9915d47

Please sign in to comment.