Skip to content

Commit bc86957

Browse files
wip: allow server migrations
1 parent 79e3fcc commit bc86957

File tree

1 file changed

+4
-3
lines changed
  • quinn-proto/src/connection

1 file changed

+4
-3
lines changed

quinn-proto/src/connection/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,7 @@ impl Connection {
16381638
// permit NAT-rebinding-like migration.
16391639
if let Some(known_remote) = self.path(path_id).map(|path| path.remote) {
16401640
if remote != known_remote && !self.side.remote_may_migrate() {
1641+
dbg!(self.side.side(), self.side.remote_may_migrate());
16411642
trace!("discarding packet from unrecognized peer {}", remote);
16421643
return;
16431644
}
@@ -3094,8 +3095,8 @@ impl Connection {
30943095
return;
30953096
}
30963097
if remote != self.path_data(path_id).remote {
3097-
debug!("discarding packet with unexpected remote during handshake");
3098-
return;
3098+
debug!("updating packet remote during handshake");
3099+
self.path_data_mut(path_id).remote = remote;
30993100
}
31003101
}
31013102

@@ -5307,7 +5308,7 @@ impl ConnectionSide {
53075308
fn remote_may_migrate(&self) -> bool {
53085309
match self {
53095310
Self::Server { server_config } => server_config.migration,
5310-
Self::Client { .. } => false,
5311+
Self::Client { .. } => true, // false,
53115312
}
53125313
}
53135314

0 commit comments

Comments
 (0)