diff options
author | Sami Kerola <kerolasa@iki.fi> | 2013-09-30 22:01:48 +0100 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2013-11-22 17:04:06 -0800 |
commit | fa10855a7e7c1cca7940001c133f09df094551dc (patch) | |
tree | 375032afb82da3027a507690746ea4b5b8ceb633 | |
parent | f26ef6ec09ea3b7a57916885ae74d9b3e5afadcc (diff) | |
download | iproute2-net-next-3.11.tar.gz |
ip: make -resolve addr to print names rather than addressesnet-next-3.11
As a system admin I occasionally want to be able to check that all
interfaces has a name in DNS or /etc/hosts file.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r-- | ip/ipaddress.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 1c3e4da0..d02eaaf8 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -636,7 +636,7 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n, fprintf(fp, " family %d ", ifa->ifa_family); if (rta_tb[IFA_LOCAL]) { - fprintf(fp, "%s", rt_addr_n2a(ifa->ifa_family, + fprintf(fp, "%s", format_host(ifa->ifa_family, RTA_PAYLOAD(rta_tb[IFA_LOCAL]), RTA_DATA(rta_tb[IFA_LOCAL]), abuf, sizeof(abuf))); @@ -647,7 +647,7 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n, fprintf(fp, "/%d ", ifa->ifa_prefixlen); } else { fprintf(fp, " peer %s/%d ", - rt_addr_n2a(ifa->ifa_family, + format_host(ifa->ifa_family, RTA_PAYLOAD(rta_tb[IFA_ADDRESS]), RTA_DATA(rta_tb[IFA_ADDRESS]), abuf, sizeof(abuf)), @@ -657,14 +657,14 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n, if (rta_tb[IFA_BROADCAST]) { fprintf(fp, "brd %s ", - rt_addr_n2a(ifa->ifa_family, + format_host(ifa->ifa_family, RTA_PAYLOAD(rta_tb[IFA_BROADCAST]), RTA_DATA(rta_tb[IFA_BROADCAST]), abuf, sizeof(abuf))); } if (rta_tb[IFA_ANYCAST]) { fprintf(fp, "any %s ", - rt_addr_n2a(ifa->ifa_family, + format_host(ifa->ifa_family, RTA_PAYLOAD(rta_tb[IFA_ANYCAST]), RTA_DATA(rta_tb[IFA_ANYCAST]), abuf, sizeof(abuf))); |