From 36cacc167184528768fe8c891426e77eb888ec18 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Fri, 16 Apr 2010 17:21:44 +0000 Subject: [PATCH] merge trellis branch changes into trunk --- gre.patch | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ iproute.spec | 2 ++ 2 files changed, 68 insertions(+) create mode 100644 gre.patch diff --git a/gre.patch b/gre.patch new file mode 100644 index 0000000..82bc161 --- /dev/null +++ b/gre.patch @@ -0,0 +1,66 @@ +diff -ur iproute2-2.6.33.orig/include/linux/if_tunnel.h iproute2-2.6.33/include/linux/if_tunnel.h +--- iproute2-2.6.33.orig/include/linux/if_tunnel.h 2010-02-24 22:56:50.000000000 -0500 ++++ iproute2-2.6.33/include/linux/if_tunnel.h 2010-04-16 11:18:49.412491322 -0400 +@@ -33,6 +33,7 @@ + __be16 o_flags; + __be32 i_key; + __be32 o_key; ++ __be16 proto_type; /* Added for EGRE */ + struct iphdr iph; + }; + +diff -ur iproute2-2.6.33.orig/ip/iptunnel.c iproute2-2.6.33/ip/iptunnel.c +--- iproute2-2.6.33.orig/ip/iptunnel.c 2010-02-24 22:56:50.000000000 -0500 ++++ iproute2-2.6.33/ip/iptunnel.c 2010-04-16 11:20:58.152357650 -0400 +@@ -28,12 +28,15 @@ + #include "ip_common.h" + #include "tunnel.h" + ++#define ETH_P_ETH 0x6558 /* Ethernet in Ethernet */ ++ ++ + static void usage(void) __attribute__((noreturn)); + + static void usage(void) + { + fprintf(stderr, "Usage: ip tunnel { add | change | del | show | prl | 6rd } [ NAME ]\n"); +- fprintf(stderr, " [ mode { ipip | gre | sit | isatap } ] [ remote ADDR ] [ local ADDR ]\n"); ++ fprintf(stderr, " [ mode { ipip | gre [ type { ip | eth } ] | sit | isatap } ] [ remote ADDR ] [ local ADDR ]\n"); + fprintf(stderr, " [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ]\n"); + fprintf(stderr, " [ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ]\n"); + fprintf(stderr, " [ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]\n"); +@@ -80,6 +83,20 @@ + exit(-1); + } + p->iph.protocol = IPPROTO_GRE; ++ NEXT_ARG(); ++ if (strcmp(*argv,"type") == 0) ++ { ++ NEXT_ARG(); ++ printf("90 route %s\n", *argv); ++ if (strcmp(*argv,"eth") == 0) ++ { ++ p->proto_type = ETH_P_ETH; ++ } ++ else ++ { ++ p->proto_type = ETH_P_IP; ++ } ++ } + } else if (strcmp(*argv, "sit") == 0 || + strcmp(*argv, "ipv6/ip") == 0) { + if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) { +@@ -316,6 +333,13 @@ + /* Do not use format_host() for local addr, + * symbolic name will not be useful. + */ ++ if(p->proto_type == ETH_P_ETH) ++ printf("%s: %s/eth remote %s local %s ", ++ p->name, ++ tnl_strproto(p->iph.protocol), ++ p->iph.daddr ? format_host(AF_INET, 4, &p->iph.daddr, s1, sizeof(s1)) : "any", ++ p->iph.saddr ? rt_addr_n2a(AF_INET, 4, &p->iph.saddr, s2, sizeof(s2)) : "any"); ++ else + printf("%s: %s/ip remote %s local %s ", + p->name, + tnl_strproto(p->iph.protocol), diff --git a/iproute.spec b/iproute.spec index 89a6dca..cdcba2b 100644 --- a/iproute.spec +++ b/iproute.spec @@ -24,6 +24,7 @@ Group: Applications/System #Source: http://developer.osdl.org/dev/iproute2/download/iproute2-%{version}-050314.tar.gz #URL: http://developer.osdl.org/dev/iproute2/ Source: iproute2-%{version}.tar.bz2 +Patch1: gre.patch License: GNU GPL BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildPrereq: tetex-latex tetex-dvips psutils linuxdoc-tools db4-devel bison flex @@ -35,6 +36,7 @@ capabilities of the Linux 2.4.x and 2.6.x kernel. %prep %setup -q -n iproute2-%{version} +%patch1 -p1 %build make -- 2.43.0