Set port properly in server-to-client reply packets

ngtcp2 was rejecting them because we have the port when constructing,
but then it was 0 on the return packet (which ngtcp2 drops because it's
coming from an unknown/invalid path).
pull/1576/head
Jason Rhinelander 3 years ago committed by Jeff Becker
parent a1a152b5c3
commit 44fc941c32
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -623,6 +623,16 @@ namespace llarp::quic
LogWarn("Incoming quic packet to invalid/closed client; dropping");
return;
}
// The server doesn't send back the port because we already know it 1-to-1 from our outgoing
// connection.
if (auto conn = static_cast<quic::Client&>(*ep).get_connection())
remote.setPort(conn->path.remote.port());
else
{
LogWarn("Incoming quic to a quic::Client without an active quic::Connection; dropping");
return;
}
}
else
{

Loading…
Cancel
Save