aboutsummaryrefslogtreecommitdiffstats
path: root/main/iproute2/1-2-iproute2-treat-gre-key-as-number-1.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-11-30 08:08:18 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-11-30 08:08:18 +0000
commite37f8c8932104ea7fabe74dba521af61f3f86d16 (patch)
treea9271b5eeaf265f958aa7e611e8ee206b1a98899 /main/iproute2/1-2-iproute2-treat-gre-key-as-number-1.patch
parent6c90774120dc94780fa3a5dee5efac9303786fa4 (diff)
downloadaports-e37f8c8932104ea7fabe74dba521af61f3f86d16.tar.bz2
aports-e37f8c8932104ea7fabe74dba521af61f3f86d16.tar.xz
main/iproute2: support xfrm upper protocol gre key
Diffstat (limited to 'main/iproute2/1-2-iproute2-treat-gre-key-as-number-1.patch')
-rw-r--r--main/iproute2/1-2-iproute2-treat-gre-key-as-number-1.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/main/iproute2/1-2-iproute2-treat-gre-key-as-number-1.patch b/main/iproute2/1-2-iproute2-treat-gre-key-as-number-1.patch
new file mode 100644
index 0000000000..1c4f4d0423
--- /dev/null
+++ b/main/iproute2/1-2-iproute2-treat-gre-key-as-number-1.patch
@@ -0,0 +1,55 @@
+From patchwork Wed Nov 24 08:18:57 2010
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+Subject: [1/2] iproute2: treat gre key as number
+Date: Tue, 23 Nov 2010 22:18:57 -0000
+From: =?utf-8?b?VGltbyBUZXLDpHMgPHRpbW8udGVyYXNAaWtpLmZpPg==?=
+X-Patchwork-Id: 72811
+Message-Id: <1290586738-27056-1-git-send-email-timo.teras@iki.fi>
+To: shemminger@linux-foundation.org, netdev@vger.kernel.org
+Cc: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+
+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)