Commit 30dd689
committed
Fix stale CASE exchange blocking new session handshake
When a Matter client restarts and sends a new CASESigma1 reusing
the same exchange ID as an in-progress handshake, the old exchange
is still awaiting CASESigma3. The new Sigma1 gets routed to the
stale exchange, producing "Invalid opcode: CASESigma1, expected:
CASESigma3" and the handshake fails.
The client must then wait through its retry/backoff cycle (typically
30-60s) before succeeding on a subsequent attempt with a different
exchange ID.
Fix: in Session::post_recv(), when an existing exchange receives a
new session request (CASESigma1 or PBKDFParamRequest), remove the
stale exchange via remove_exch() and fall through to create a fresh
one. remove_exch() either clears the slot immediately (allowing the
new exchange to reuse it) or marks it as Dropped if MRP operations
are pending.1 parent 2af46c4 commit 30dd689
1 file changed
Lines changed: 26 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
316 | 324 | | |
317 | | - | |
| 325 | + | |
318 | 326 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
| 327 | + | |
328 | 328 | | |
| 329 | + | |
329 | 330 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
335 | 336 | | |
336 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
337 | 341 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
342 | 347 | | |
343 | 348 | | |
344 | 349 | | |
| |||
0 commit comments