Index: iproute2/ip/iptunnel.c =================================================================== RCS file: /cvs/sw/new-wave/user/iproute2/ip/iptunnel.c,v retrieving revision 1.4 diff -u -p -r1.4 iptunnel.c --- iproute2/ip/iptunnel.c 17 Sep 2003 10:04:44 -0000 1.4 +++ iproute2/ip/iptunnel.c 11 Aug 2006 04:19:50 -0000 @@ -30,6 +30,7 @@ #include #include +#include "../lib/if_ether.h" #include "if_tunnel.h" #include "rt_names.h" #include "utils.h" @@ -186,11 +187,20 @@ static int parse_args(int argc, char **a p->iph.protocol = IPPROTO_IPIP; } else if (strcmp(*argv, "gre") == 0 || strcmp(*argv, "gre/ip") == 0) { - if (p->iph.protocol && p->iph.protocol != IPPROTO_GRE) { + if (p->iph.protocol && (p->iph.protocol != IPPROTO_GRE || p->iph.id != 0)) { fprintf(stderr,"You managed to ask for more than one tunnel mode.\n"); exit(-1); } p->iph.protocol = IPPROTO_GRE; + } else if (strcmp(*argv, "eogre") == 0 || + strcmp(*argv, "ether/gre") == 0 || + strcmp(*argv, "ether/gre/ip") == 0) { + if (p->iph.protocol && (p->iph.protocol != IPPROTO_GRE || p->iph.id != htons(ETH_P_BRIDGE))) { + fprintf(stderr,"You managed to ask for more than one tunnel mode.\n"); + exit(-1); + } + p->iph.protocol = IPPROTO_GRE; + p->iph.id = htons(ETH_P_BRIDGE); } else if (strcmp(*argv, "sit") == 0 || strcmp(*argv, "ipv6/ip") == 0) { if (p->iph.protocol && p->iph.protocol != IPPROTO_IPV6) { @@ -409,8 +419,9 @@ void print_tunnel(struct ip_tunnel_parm inet_ntop(AF_INET, &p->i_key, s3, sizeof(s3)); inet_ntop(AF_INET, &p->o_key, s4, sizeof(s4)); - printf("%s: %s/ip remote %s local %s ", + printf("%s: %s%s/ip remote %s local %s ", p->name, + p->iph.id == htons(ETH_P_BRIDGE) ? "ether/" : "", p->iph.protocol == IPPROTO_IPIP ? "ip" : (p->iph.protocol == IPPROTO_GRE ? "gre" : (p->iph.protocol == IPPROTO_IPV6 ? "ipv6" : "unknown")), Index: iproute2/lib/if_ether.h =================================================================== RCS file: /cvs/sw/new-wave/user/iproute2/lib/if_ether.h,v retrieving revision 1.1 diff -u -p -r1.1 if_ether.h --- iproute2/lib/if_ether.h 10 Sep 2003 05:25:08 -0000 1.1 +++ iproute2/lib/if_ether.h 11 Aug 2006 04:19:50 -0000 @@ -53,6 +53,7 @@ #define ETH_P_DIAG 0x6005 /* DEC Diagnostics */ #define ETH_P_CUST 0x6006 /* DEC Customer use */ #define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ +#define ETH_P_BRIDGE 0x6558 /* Transparent Ethernet Bridging */ #define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ #define ETH_P_ATALK 0x809B /* Appletalk DDP */ #define ETH_P_AARP 0x80F3 /* Appletalk AARP */