#3 - DNS support + IPv6

This commit is contained in:
Martin Slachta
2026-08-05 17:14:04 +02:00
parent 0e639abcd2
commit b71f740b9a
13 changed files with 291 additions and 92 deletions
+12 -1
View File
@@ -15,7 +15,18 @@ QuicrPeerLink::QuicrPeerLink(uint32_t self_id, uint16_t port)
{}
void QuicrPeerLink::connect_to(uint32_t peer_id, const tw::net::Address& addr) {
auto r = m_endpoint->connect(net::quicr::QuicrAddress(addr.ip_string(), addr.port()));
// The address is rebuilt from its text, which for a mapped or IPv6 peer is
// more than the literal constructor can parse, so it goes back through the
// resolver — into the endpoint's family, since that is what will send it.
auto address_r = net::quicr::QuicrAddress::resolve(addr.ip_string(), addr.port(),
m_endpoint->family());
if (!address_r) {
spdlog::warn("QuicrPeerLink[{}]: address of peer {} failed to resolve: {}",
m_self_id, peer_id, address_r.error().message());
return;
}
auto r = m_endpoint->connect(address_r.value());
if (!r) {
spdlog::warn("QuicrPeerLink[{}]: connect to peer {} failed", m_self_id, peer_id);
return;