diff --git a/src/net/linux/addrs.c b/src/net/linux/addrs.c index 24bed62e5..1422721d2 100644 --- a/src/net/linux/addrs.c +++ b/src/net/linux/addrs.c @@ -124,7 +124,16 @@ static bool parse_msg_addr(struct nlmsghdr *msg, ssize_t len, } } else if (ifa->ifa_family == AF_INET6) { - sa_set_in6(&sa, RTA_DATA(rta_tb[IFA_ADDRESS]), 0); + if (rta_tb[IFA_LOCAL]) { + /* looks like point-to-point network, use local + * address, instead of peer */ + sa_set_in6(&sa, RTA_DATA(rta_tb[IFA_LOCAL]), + 0); + } + else { + sa_set_in6(&sa, RTA_DATA(rta_tb[IFA_ADDRESS]), + 0); + } sa_set_scopeid(&sa, ifa->ifa_index); } else