Commit 973eb50b authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by Stephen Hemminger

ipadress: fix display of IPv6 peer address

Because only IPv4 was supported, the size was static. Now, IPv6 also supports
peer address.
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
parent 7cfa3802
......@@ -636,7 +636,8 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n,
abuf, sizeof(abuf)));
if (rta_tb[IFA_ADDRESS] == NULL ||
memcmp(RTA_DATA(rta_tb[IFA_ADDRESS]), RTA_DATA(rta_tb[IFA_LOCAL]), 4) == 0) {
memcmp(RTA_DATA(rta_tb[IFA_ADDRESS]), RTA_DATA(rta_tb[IFA_LOCAL]),
ifa->ifa_family == AF_INET ? 4 : 16) == 0) {
fprintf(fp, "/%d ", ifa->ifa_prefixlen);
} else {
fprintf(fp, " peer %s/%d ",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment