mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-04 13:55:23 -05:00
net: make it possible to connect to CJDNS addresses
Connecting to CJDNS addresses works without a proxy, just like connecting to an IPv6 address. Thus adapt `CService::GetSockAddr()` to retrieve the `struct sockaddr*` even for `CService::IsCJDNS()` objects.
This commit is contained in:
parent
23ae7931be
commit
aedd02ef27
1 changed files with 3 additions and 3 deletions
|
@ -663,7 +663,7 @@ bool CNetAddr::GetInAddr(struct in_addr* pipv4Addr) const
|
|||
}
|
||||
|
||||
/**
|
||||
* Try to get our IPv6 address.
|
||||
* Try to get our IPv6 (or CJDNS) address.
|
||||
*
|
||||
* @param[out] pipv6Addr The in6_addr struct to which to copy.
|
||||
*
|
||||
|
@ -674,7 +674,7 @@ bool CNetAddr::GetInAddr(struct in_addr* pipv4Addr) const
|
|||
*/
|
||||
bool CNetAddr::GetIn6Addr(struct in6_addr* pipv6Addr) const
|
||||
{
|
||||
if (!IsIPv6()) {
|
||||
if (!IsIPv6() && !IsCJDNS()) {
|
||||
return false;
|
||||
}
|
||||
assert(sizeof(*pipv6Addr) == m_addr.size());
|
||||
|
@ -993,7 +993,7 @@ bool CService::GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const
|
|||
paddrin->sin_port = htons(port);
|
||||
return true;
|
||||
}
|
||||
if (IsIPv6()) {
|
||||
if (IsIPv6() || IsCJDNS()) {
|
||||
if (*addrlen < (socklen_t)sizeof(struct sockaddr_in6))
|
||||
return false;
|
||||
*addrlen = sizeof(struct sockaddr_in6);
|
||||
|
|
Loading…
Add table
Reference in a new issue