Dead condition in AssembleWithContext
- Dominant language
- Go
- Stars
- 6.8k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
IMHO
The condition `else if a.start` is never reached in the code below because `if t.SYN` is always true when a.start is true
```go
if half.nextSeq == invalidSequence {
if t.SYN {
if *debugLog {
log.Printf("%v saw first SYN packet, returning immediately, seq=%v", key, seq)
}
seq = seq.Add(1)
half.nextSeq = seq
action.queue = false
} else if a.start {
if *debugLog {
log.Printf("%v start forced", key)
}
half.nextSeq = seq
action.queue = false
} else {
if *debugLog {
log.Printf("%v waiting for start, storing into connection", key)
}
}
}
```
https://github.com/google/gopacket/blob/bf568f6eadb6968267219a891af2813771b6b9a1/reassembly/tcpassembly.go#L700
Samuel
Contributor guide
Assessment
This issue has not been assessed yet.