Skip to content

Commit

Permalink
Fixes CIDs used after NAT rebinding in connection_migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiraux committed May 8, 2020
1 parent e493443 commit bde58c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scenarii/connection_migration.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package scenarii

import (
"bytes"
qt "github.com/QUIC-Tracker/quic-tracker"
"math/rand"

Expand Down Expand Up @@ -60,8 +61,6 @@ wait:
}

connAgents.Stop("SocketAgent", "SendingAgent")
conn.DestinationCID = ncid
conn.SourceCID = scid

newUdpConn, err := qt.EstablishUDPConnection(conn.Host)
if err != nil {
Expand All @@ -87,6 +86,10 @@ wait:
p := i.(qt.Packet)
if trace.ErrorCode == CM_HostDidNotMigrate {
trace.ErrorCode = CM_HostDidNotValidateNewPath
if bytes.Equal(p.Header().DestinationConnectionID(), scid) && ncid != nil {
conn.SourceCID = scid
conn.DestinationCID = ncid
}
}

if fp, ok := p.(qt.Framer); ok && fp.Contains(qt.PathChallengeType) {
Expand Down

0 comments on commit bde58c3

Please sign in to comment.