mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 20:50:00 +00:00
TUN-6744: On posix platforms, assign unique echo ID per (src, dst, echo ID)
This also refactor FunnelTracker to provide a GetOrRegister method to prevent race condition
This commit is contained in:
@@ -32,17 +32,10 @@ func netipAddr(addr net.Addr) (netip.Addr, bool) {
|
||||
return netip.AddrFromSlice(udpAddr.IP)
|
||||
}
|
||||
|
||||
type flowID struct {
|
||||
srcIP netip.Addr
|
||||
echoID int
|
||||
}
|
||||
|
||||
func (fi *flowID) Type() string {
|
||||
return "srcIP_echoID"
|
||||
}
|
||||
|
||||
func (fi *flowID) String() string {
|
||||
return fmt.Sprintf("%s:%d", fi.srcIP, fi.echoID)
|
||||
type flow3Tuple struct {
|
||||
srcIP netip.Addr
|
||||
dstIP netip.Addr
|
||||
originalEchoID int
|
||||
}
|
||||
|
||||
// icmpEchoFlow implements the packet.Funnel interface.
|
||||
|
Reference in New Issue
Block a user