mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
Add missing getIPv6 implementation
This commit is contained in:
parent
38f0c8091b
commit
35e4e8817b
|
@ -342,6 +342,17 @@ namespace llarp
|
||||||
return {m_addr4.sin_addr.s_addr};
|
return {m_addr4.sin_addr.s_addr};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nuint128_t
|
||||||
|
SockAddr::getIPv6() const
|
||||||
|
{
|
||||||
|
nuint128_t a;
|
||||||
|
// Explicit cast to void* here to avoid non-trivial type copying warnings (technically this
|
||||||
|
// isn't trivial because of the zeroing default constructor, but it's trivial enough that this
|
||||||
|
// copy is safe).
|
||||||
|
std::memcpy(static_cast<void*>(&a), &m_addr.sin6_addr, 16);
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SockAddr::setIPv4(nuint32_t ip)
|
SockAddr::setIPv4(nuint32_t ip)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue