MCPcopy Index your code
hub / github.com/tailscale/tailscale / trackOpenPostFilterOut

Method trackOpenPostFilterOut

wgengine/pendopen.go:148–176  ·  view source on GitHub ↗
(pp *packet.Parsed, t *tstun.Wrapper)

Source from the content-addressed store, hash-verified

146}
147
148func (e *userspaceEngine) trackOpenPostFilterOut(pp *packet.Parsed, t *tstun.Wrapper) (res filter.Response) {
149 res = filter.Accept // always
150
151 if pp.IPVersion == 0 ||
152 pp.IPProto != ipproto.TCP ||
153 pp.TCPFlags&packet.TCPAck != 0 ||
154 pp.TCPFlags&packet.TCPSyn == 0 {
155 return
156 }
157 if e.isOSNetworkProbe(pp.Dst) {
158 return
159 }
160
161 flow := flowtrack.MakeTuple(pp.IPProto, pp.Src, pp.Dst)
162
163 e.mu.Lock()
164 defer e.mu.Unlock()
165 if _, dup := e.pendOpen[flow]; dup {
166 // Duplicates are expected when the OS retransmits. Ignore.
167 return
168 }
169
170 timer := time.AfterFunc(tcpTimeoutBeforeDebug, func() {
171 e.onOpenTimeout(flow)
172 })
173 mak.Set(&e.pendOpen, flow, &pendingOpenFlow{timer: timer})
174
175 return filter.Accept
176}
177
178func (e *userspaceEngine) onOpenTimeout(flow flowtrack.Tuple) {
179 e.mu.Lock()

Callers

nothing calls this directly

Calls 7

isOSNetworkProbeMethod · 0.95
onOpenTimeoutMethod · 0.95
MakeTupleFunction · 0.92
SetFunction · 0.92
LockMethod · 0.65
UnlockMethod · 0.65
AfterFuncMethod · 0.65

Tested by

no test coverage detected