fix address of point-to-point interfaces (#3039)

This commit is contained in:
Steven Siloti 2018-05-16 15:54:46 -07:00 committed by Arvid Norberg
parent 7621be6df1
commit 9a48ef761e
1 changed files with 8 additions and 0 deletions

View File

@ -352,6 +352,7 @@ namespace {
}
}
ip_info->interface_address = address();
int rt_len = int(IFA_PAYLOAD(nl_hdr));
#ifdef __clang__
#pragma clang diagnostic push
@ -363,6 +364,13 @@ namespace {
switch(rt_attr->rta_type)
{
case IFA_ADDRESS:
// if this is a point-to-point link then IFA_LOCAL holds
// the local address while IFA_ADDRESS is the destination
// don't overwrite the former with the latter
if (!ip_info->interface_address.is_unspecified())
break;
BOOST_FALLTHROUGH;
case IFA_LOCAL:
#if TORRENT_USE_IPV6
if (addr_msg->ifa_family == AF_INET6)
{