Skip to content

Commit

Permalink
Merge pull request #393 from fatanugraha/main
Browse files Browse the repository at this point in the history
Fix consistent udp packet loss after the proxy read loop stopped
  • Loading branch information
openshift-merge-bot[bot] authored Sep 18, 2024
2 parents 6c71164 + cdb2efa commit ded1408
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/services/forwarder/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ func UDP(s *stack.Stack, nat map[tcpip.Address]tcpip.Address, natLock *sync.Mute
p, _ := NewUDPProxy(&autoStoppingListener{underlying: gonet.NewUDPConn(s, &wq, ep)}, func() (net.Conn, error) {
return net.Dial("udp", fmt.Sprintf("%s:%d", localAddress, r.ID().LocalPort))
})
go p.Run()
go func() {
p.Run()

// note that at this point packets that are sent to the current forwarder session
// will be dropped. We will start processing the packets again when we get a new
// forwarder request.
ep.Close()
}()
})
}

0 comments on commit ded1408

Please sign in to comment.