libquic bump

pull/2221/head
dr7ana 7 months ago
parent 2ee70921bc
commit 826ef2bbe6

@ -1 +1 @@
Subproject commit 6ee6ed398d00043d862466a56279b5c502513bff
Subproject commit 3ced484e8cc543b90c5fc554ccc0ea2e54ec8d37

@ -961,9 +961,8 @@ namespace llarp
maybe = oxen::quic::Address{std::string{h}, p};
// TODO: unfuck llarp/net
// if (net_ptr->IsLoopbackAddress(addr->port()))
// throw std::invalid_argument{fmt::format("{} is a loopback address", arg)};
if (maybe->is_loopback())
throw std::invalid_argument{fmt::format("{} is a loopback address", arg)};
}
if (not maybe)
{
@ -1103,34 +1102,40 @@ namespace llarp
});
conf.add_undeclared_handler(
"bind", [this, net_ptr](std::string_view, std::string_view key, std::string_view val) {
"bind", [this](std::string_view, std::string_view key, std::string_view val) {
if (using_new_api)
throw std::runtime_error{"USE THE NEW API -- SPECIFY LOCAL ADDRESS UNDER [LISTEN]"};
log::warning(
logcat, "Using the [bind] section is beyond deprecated; use [listen] instead");
log::warning(logcat, "Please update your config to use [bind]:listen instead");
uint16_t port{0};
if (auto rv = llarp::parse_int<uint16_t>(val, port); not rv)
throw std::runtime_error{"Could not parse port; stop using this deprecated handler"};
port = port == 0 ? DEFAULT_LISTEN_PORT : port;
// special case: wildcard for outbound
if (key == "*")
{
uint16_t port{0};
if (auto rv = llarp::parse_int<uint16_t>(val, port); not rv)
log::warning(
logcat, "Could not parse port; stop using this deprecated handler you nonce");
addr = oxen::quic::Address{"", port}; // TODO: drop the "" after bumping libquic
addr = oxen::quic::Address{port};
return;
}
oxen::quic::Address temp;
// try as interface name first
auto saddr = net_ptr->GetInterfaceAddr(key, AF_INET);
if (saddr and net_ptr->IsLoopbackAddress(saddr->getIP()))
throw std::invalid_argument{fmt::format("{} is a loopback interface", key)};
temp = oxen::quic::Address{saddr->in()};
try
{
temp = oxen::quic::Address{std::string{key}, port};
}
catch (const std::exception& e)
{
throw std::runtime_error{fmt::format(
"Could not parse address {}; please update your config to use [bind]:listen "
"instead: {}",
key,
e.what())};
}
if (temp.is_addressable())
{
@ -1138,10 +1143,10 @@ namespace llarp
return;
}
log::warning(
logcat,
"Could not parse address values; stop using this deprecated handler you nonce");
addr = oxen::quic::Address{""s, DEFAULT_LISTEN_PORT};
throw std::runtime_error{fmt::format(
"Invalid address: {}; stop using this deprecated handler, update your config to use "
"[bind]:listen instead PLEASE",
temp)};
});
}

@ -314,7 +314,9 @@ namespace llarp
// TODO: confirm remote end is using the expected pubkey (RouterID).
// TODO: ALPN for "client" vs "relay" (could just be set on endpoint creation)
if (auto rv = ep.establish_connection(remote_addr, rc); rv)
if (auto rv = ep.establish_connection(
oxen::quic::RemoteAddress{rc.router_id().ToView(), remote_addr}, rc);
rv)
{
log::info(quic_cat, "Connection to {} successfully established!", remote_addr);
return;

@ -71,7 +71,8 @@ namespace llarp
template <typename... Opt>
bool
establish_connection(const oxen::quic::Address& remote, const RemoteRC& rc, Opt&&... opts);
establish_connection(
const oxen::quic::RemoteAddress& remote, const RemoteRC& rc, Opt&&... opts);
void
for_each_connection(std::function<void(link::Connection&)> func);
@ -364,7 +365,7 @@ namespace llarp
template <typename... Opt>
bool
Endpoint::establish_connection(
const oxen::quic::Address& remote, const RemoteRC& rc, Opt&&... opts)
const oxen::quic::RemoteAddress& remote, const RemoteRC& rc, Opt&&... opts)
{
try
{

@ -12,32 +12,6 @@
namespace llarp
{
// RouterContact::RouterContact(std::string buf)
// {
// try
// {
// oxenc::bt_list_consumer btlc{buf};
// // signature.from_string(btlc.consume_string());
// signed_bt_dict = btlc.consume_string();
// // TODO: parse bt dict
// }
// catch (...)
// {
// log::warning(llarp_cat, "Error: RouterContact failed to populate bt encoded contents!");
// }
// }
// std::string
// RouterContact::bt_encode() const
// {
// oxenc::bt_dict_producer btdp;
// bt_encode(btdp);
// return std::move(btdp).str();
// }
void
RouterContact::bt_load(oxenc::bt_dict_consumer& data)
{

@ -244,7 +244,7 @@ namespace llarp
void
clear() override
{
_addr = {};
_addr = oxen::quic::Address{};
_addr6.reset();
_router_id.Zero();
_timestamp = {};
@ -338,7 +338,7 @@ namespace llarp
void
clear() override
{
_addr = {};
_addr = oxen::quic::Address{};
_addr6.reset();
_router_id.Zero();
_timestamp = {};

Loading…
Cancel
Save