Skip to content

Commit

Permalink
same fix for IPv6
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Dec 23, 2024
1 parent eeb1a96 commit 3bd3d24
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/net/linux/addrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3bd3d24

Please sign in to comment.