]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
iproute2: treat gre key as number
authorTimo Teräs <timo.teras@iki.fi>
Tue, 23 Nov 2010 22:18:57 +0000 (22:18 +0000)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Tue, 30 Nov 2010 17:52:32 +0000 (09:52 -0800)
Print GRE key as a regular number. It is not really an IPv4 address
and this is also how Cisco and Juniper treats GRE keys. Do keep the
parsing of dotted-quad format for backwards compatibility.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
ip/iptunnel.c

index 2a5c1a1942d26843ad7e093293a430c6c6bec35f..fe5e3f968855648700cd1d5ac8ce15b27ba9d282 100644 (file)
@@ -306,12 +306,8 @@ static void print_tunnel(struct ip_tunnel_parm *p)
        struct ip_tunnel_6rd ip6rd;
        char s1[1024];
        char s2[1024];
-       char s3[64];
-       char s4[64];
 
        memset(&ip6rd, 0, sizeof(ip6rd));
-       inet_ntop(AF_INET, &p->i_key, s3, sizeof(s3));
-       inet_ntop(AF_INET, &p->o_key, s4, sizeof(s4));
 
        /* Do not use format_host() for local addr,
         * symbolic name will not be useful.
@@ -377,12 +373,12 @@ static void print_tunnel(struct ip_tunnel_parm *p)
        }
 
        if ((p->i_flags&GRE_KEY) && (p->o_flags&GRE_KEY) && p->o_key == p->i_key)
-               printf(" key %s", s3);
+               printf(" key %u", ntohl(p->i_key));
        else if ((p->i_flags|p->o_flags)&GRE_KEY) {
                if (p->i_flags&GRE_KEY)
-                       printf(" ikey %s ", s3);
+                       printf(" ikey %u ", ntohl(p->i_key));
                if (p->o_flags&GRE_KEY)
-                       printf(" okey %s ", s4);
+                       printf(" okey %u ", ntohl(p->o_key));
        }
 
        if (p->i_flags&GRE_SEQ)