Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heuristics to fix interop with bad ZeroChecksum #327

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions association.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
peerVerificationTag uint32
myVerificationTag uint32
state uint32
initialTSN uint32
myNextTSN uint32 // nextTSN
peerLastTSN uint32 // lastRcvdTSN
minTSN2MeasureRTT uint32 // for RTT measurement
Expand Down Expand Up @@ -336,6 +337,7 @@
mtu: initialMTU,
maxPayloadSize: initialMTU - (commonHeaderSize + dataChunkHeaderSize),
myVerificationTag: globalMathRandomGenerator.Uint32(),
initialTSN: tsn,
myNextTSN: tsn,
myNextRSN: tsn,
minTSN2MeasureRTT: tsn,
Expand Down Expand Up @@ -2553,6 +2555,12 @@
a.lock.Lock()
defer a.lock.Unlock()

// TSN hasn't been incremented in 3 attempts. Speculatively
// disable ZeroChecksum because old Pion versions had a broken implementation
if a.cumulativeTSNAckPoint+1 == a.initialTSN && nRtos == 3 {
a.sendZeroChecksum = false
}

Check warning on line 2562 in association.go

View check run for this annotation

Codecov / codecov/patch

association.go#L2561-L2562

Added lines #L2561 - L2562 were not covered by tests

if id == timerT1Init {
err := a.sendInit()
if err != nil {
Expand Down
Loading