From: "Timo Teräs" <timo.teras@iki.fi>
To: shemminger@linux-foundation.org, netdev@vger.kernel.org
Cc: "Timo Teräs" <timo.teras@iki.fi>
Subject: [PATCH 1/2] iproute2: treat gre key as number
Date: Wed, 24 Nov 2010 10:18:57 +0200 [thread overview]
Message-ID: <1290586738-27056-1-git-send-email-timo.teras@iki.fi> (raw)
In-Reply-To: <20101123105418.65072de8@nehalam>
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 | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/ip/iptunnel.c b/ip/iptunnel.c
index 3525fbb..48faf69 100644
--- a/ip/iptunnel.c
+++ b/ip/iptunnel.c
@@ -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)
--
1.7.1
next prev parent reply other threads:[~2010-11-24 8:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-23 15:02 [PATCH] iproute2: support xfrm upper protocol gre key Timo Teräs
2010-11-23 16:24 ` Stephen Hemminger
2010-11-23 16:44 ` Timo Teräs
2010-11-23 18:13 ` Stephen Hemminger
2010-11-23 18:38 ` Timo Teräs
2010-11-23 18:54 ` Stephen Hemminger
2010-11-24 8:18 ` Timo Teräs [this message]
2010-11-24 8:18 ` [PATCH 2/2] " Timo Teräs
2010-11-30 17:55 ` Stephen Hemminger
2010-11-23 22:26 ` [PATCH] " Ben Hutchings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1290586738-27056-1-git-send-email-timo.teras@iki.fi \
--to=timo.teras@iki.fi \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).