naccyde / rpms / iproute

Forked from rpms/iproute 10 months ago
Clone

Blame SOURCES/0097-ip-make-resolve-addr-to-print-names-rather-than-addr.patch

4aca6e
From 678ff7158b887b5ecd32e5c6be319a8541001b50 Mon Sep 17 00:00:00 2001
4aca6e
From: Phil Sutter <psutter@redhat.com>
4aca6e
Date: Fri, 17 Mar 2017 13:17:53 +0100
4aca6e
Subject: [PATCH] ip: make -resolve addr to print names rather than addresses
4aca6e
4aca6e
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1422629
4aca6e
Upstream Status: iproute2.git commit ffa35d930b9ba
4aca6e
4aca6e
commit ffa35d930b9bae8324768c5b018adaf26258aff9
4aca6e
Author: Sami Kerola <kerolasa@iki.fi>
4aca6e
Date:   Mon Sep 30 22:01:48 2013 +0100
4aca6e
4aca6e
    ip: make -resolve addr to print names rather than addresses
4aca6e
4aca6e
    As a system admin I occasionally want to be able to check that all
4aca6e
    interfaces has a name in DNS or /etc/hosts file.
4aca6e
4aca6e
    Signed-off-by: Sami Kerola <kerolasa@iki.fi>
4aca6e
---
4aca6e
 ip/ipaddress.c | 8 ++++----
4aca6e
 1 file changed, 4 insertions(+), 4 deletions(-)
4aca6e
4aca6e
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
4aca6e
index d5bc2dc..147bcca 100644
4aca6e
--- a/ip/ipaddress.c
4aca6e
+++ b/ip/ipaddress.c
4aca6e
@@ -864,7 +864,7 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n,
4aca6e
 		fprintf(fp, "    family %d ", ifa->ifa_family);
4aca6e
 
4aca6e
 	if (rta_tb[IFA_LOCAL]) {
4aca6e
-		fprintf(fp, "%s", rt_addr_n2a(ifa->ifa_family,
4aca6e
+		fprintf(fp, "%s", format_host(ifa->ifa_family,
4aca6e
 					      RTA_PAYLOAD(rta_tb[IFA_LOCAL]),
4aca6e
 					      RTA_DATA(rta_tb[IFA_LOCAL]),
4aca6e
 					      abuf, sizeof(abuf)));
4aca6e
@@ -875,7 +875,7 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n,
4aca6e
 			fprintf(fp, "/%d ", ifa->ifa_prefixlen);
4aca6e
 		} else {
4aca6e
 			fprintf(fp, " peer %s/%d ",
4aca6e
-				rt_addr_n2a(ifa->ifa_family,
4aca6e
+				format_host(ifa->ifa_family,
4aca6e
 					    RTA_PAYLOAD(rta_tb[IFA_ADDRESS]),
4aca6e
 					    RTA_DATA(rta_tb[IFA_ADDRESS]),
4aca6e
 					    abuf, sizeof(abuf)),
4aca6e
@@ -885,14 +885,14 @@ int print_addrinfo(const struct sockaddr_nl *who, struct nlmsghdr *n,
4aca6e
 
4aca6e
 	if (rta_tb[IFA_BROADCAST]) {
4aca6e
 		fprintf(fp, "brd %s ",
4aca6e
-			rt_addr_n2a(ifa->ifa_family,
4aca6e
+			format_host(ifa->ifa_family,
4aca6e
 				    RTA_PAYLOAD(rta_tb[IFA_BROADCAST]),
4aca6e
 				    RTA_DATA(rta_tb[IFA_BROADCAST]),
4aca6e
 				    abuf, sizeof(abuf)));
4aca6e
 	}
4aca6e
 	if (rta_tb[IFA_ANYCAST]) {
4aca6e
 		fprintf(fp, "any %s ",
4aca6e
-			rt_addr_n2a(ifa->ifa_family,
4aca6e
+			format_host(ifa->ifa_family,
4aca6e
 				    RTA_PAYLOAD(rta_tb[IFA_ANYCAST]),
4aca6e
 				    RTA_DATA(rta_tb[IFA_ANYCAST]),
4aca6e
 				    abuf, sizeof(abuf)));
4aca6e
-- 
4aca6e
1.8.3.1
4aca6e