| 603 | } |
| 604 | |
| 605 | func (ns *Impl) decrementInFlightTCPForward(tei stack.TransportEndpointID, remoteAddr netip.Addr) { |
| 606 | ns.mu.Lock() |
| 607 | defer ns.mu.Unlock() |
| 608 | |
| 609 | // Remove this packet so future SYNs from this address will be handled. |
| 610 | delete(ns.packetsInFlight, tei) |
| 611 | |
| 612 | was := ns.connsInFlightByClient[remoteAddr] |
| 613 | newVal := was - 1 |
| 614 | if newVal == 0 { |
| 615 | delete(ns.connsInFlightByClient, remoteAddr) // free up space in the map |
| 616 | } else { |
| 617 | ns.connsInFlightByClient[remoteAddr] = newVal |
| 618 | } |
| 619 | } |
| 620 | |
| 621 | // LocalBackend is a fake name for *ipnlocal.LocalBackend to avoid an import cycle. |
| 622 | type LocalBackend = any |