fix bad_variant_access resulting from ConvoTag->AddressVariant change

We changed the quic code to refer to its remote endpoint using an Address Variant
and this resulted in a crash when sending a connection close packet.  This code was
incorrectly supplying an uninitialized value for ConvoTag before but this was silently
ignored; after switching to a variant it became a crash.
pull/2141/head
Thomas Winget 1 year ago
parent c899e1286a
commit 5514a27a59

@ -295,11 +295,10 @@ namespace llarp::quic
close_reason.size());
conn.conn_buffer.resize(max_pkt_size_v4);
Path path;
ngtcp2_pkt_info pi;
auto written = ngtcp2_conn_write_connection_close(
conn, path, &pi, u8data(conn.conn_buffer), conn.conn_buffer.size(), &err, get_timestamp());
conn, &conn.path.path, &pi, u8data(conn.conn_buffer), conn.conn_buffer.size(), &err, get_timestamp());
if (written <= 0)
{
log::warning(
@ -314,8 +313,6 @@ namespace llarp::quic
conn.conn_buffer.resize(written);
conn.closing = true;
conn.path = path;
assert(conn.closing && !conn.conn_buffer.empty());
if (auto sent = send_packet(conn.path.remote, conn.conn_buffer, 0); not sent)
@ -411,6 +408,7 @@ namespace llarp::quic
conns.erase(it);
if (primary)
clean_alias_conns();
return true;
}

Loading…
Cancel
Save