mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-16 11:53:07 +02:00
net: Add missing verification of IPv6 address in CNetAddr::GetIn6Addr(...)
This commit is contained in:
parent
f58674a20a
commit
2fb0066b99
@ -300,6 +300,9 @@ bool CNetAddr::GetInAddr(struct in_addr* pipv4Addr) const
|
|||||||
|
|
||||||
bool CNetAddr::GetIn6Addr(struct in6_addr* pipv6Addr) const
|
bool CNetAddr::GetIn6Addr(struct in6_addr* pipv6Addr) const
|
||||||
{
|
{
|
||||||
|
if (!IsIPv6()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
memcpy(pipv6Addr, ip, 16);
|
memcpy(pipv6Addr, ip, 16);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user