Blame SOURCES/0102-ip6tunnel-print-local-remote-addresses-like-iptunnel.patch

4aca6e
From 719beca22da7196c78202302d57e67d1c0ffc2cb Mon Sep 17 00:00:00 2001
4aca6e
From: Phil Sutter <psutter@redhat.com>
4aca6e
Date: Fri, 17 Mar 2017 13:19:41 +0100
4aca6e
Subject: [PATCH] ip6tunnel: print local/remote addresses like iptunnel does
4aca6e
4aca6e
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1422629
4aca6e
Upstream Status: iproute2.git commit 9af72f819e3fa
4aca6e
4aca6e
commit 9af72f819e3fa288fd56e74d14a1253bd49adb9d
4aca6e
Author: Phil Sutter <phil@nwl.cc>
4aca6e
Date:   Fri Nov 13 18:08:59 2015 +0100
4aca6e
4aca6e
    ip6tunnel: print local/remote addresses like iptunnel does
4aca6e
4aca6e
    This makes output consistent with iptunnel, also supporting reverse DNS
4aca6e
    lookup for remote address if requested.
4aca6e
4aca6e
    Signed-off-by: Phil Sutter <phil@nwl.cc>
4aca6e
---
4aca6e
 ip/ip6tunnel.c | 15 +++++++++------
4aca6e
 1 file changed, 9 insertions(+), 6 deletions(-)
4aca6e
4aca6e
diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
4aca6e
index f37042e..97c99e2 100644
4aca6e
--- a/ip/ip6tunnel.c
4aca6e
+++ b/ip/ip6tunnel.c
4aca6e
@@ -69,14 +69,17 @@ static void usage(void)
4aca6e
 
4aca6e
 static void print_tunnel(struct ip6_tnl_parm2 *p)
4aca6e
 {
4aca6e
-	char remote[64];
4aca6e
-	char local[64];
4aca6e
-
4aca6e
-	inet_ntop(AF_INET6, &p->raddr, remote, sizeof(remote));
4aca6e
-	inet_ntop(AF_INET6, &p->laddr, local, sizeof(local));
4aca6e
+	char s1[1024];
4aca6e
+	char s2[1024];
4aca6e
 
4aca6e
+	/* Do not use format_host() for local addr,
4aca6e
+	 * symbolic name will not be useful.
4aca6e
+	 */
4aca6e
 	printf("%s: %s/ipv6 remote %s local %s",
4aca6e
-	       p->name, tnl_strproto(p->proto), remote, local);
4aca6e
+	       p->name,
4aca6e
+	       tnl_strproto(p->proto),
4aca6e
+	       format_host(AF_INET6, 16, &p->raddr, s1, sizeof(s1)),
4aca6e
+	       rt_addr_n2a(AF_INET6, 16, &p->laddr, s2, sizeof(s2)));
4aca6e
 	if (p->link) {
4aca6e
 		const char *n = ll_index_to_name(p->link);
4aca6e
 		if (n)
4aca6e
-- 
4aca6e
1.8.3.1
4aca6e