Skip to content

Commit

Permalink
net: pass ipv6 zone param to net.ListenUDP
Browse files Browse the repository at this point in the history
  • Loading branch information
N1cOs committed Nov 26, 2024
1 parent 2c699d8 commit d3aef08
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions net.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,13 @@ func listenUDPInPortRange(n transport.Net, log logging.LeveledLogger, portMax, p
portStart := globalMathRandomGenerator.Intn(j-i+1) + i
portCurrent := portStart
for {
lAddr = &net.UDPAddr{IP: lAddr.IP, Port: portCurrent}
c, e := n.ListenUDP(network, lAddr)
addr := &net.UDPAddr{
IP: lAddr.IP,
Zone: lAddr.Zone,
Port: portCurrent,
}

c, e := n.ListenUDP(network, addr)
if e == nil {
return c, e //nolint:nilerr
}
Expand Down

0 comments on commit d3aef08

Please sign in to comment.