From: Hangbin Liu Date: Thu, 5 Dec 2013 16:19:01 +0000 (+0800) Subject: iptunnel: Allow GRE_KEY for vti interface X-Git-Tag: v3.14.0~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c28bd597bdac6948fe8321f9abf4cb943270d1b;p=thirdparty%2Fiproute2.git iptunnel: Allow GRE_KEY for vti interface The vti interface will use GRE_KEY to match the right policy in kernel. So we can not return fail when the tunnel is vti. Signed-off-by: Hangbin Liu --- diff --git a/ip/iptunnel.c b/ip/iptunnel.c index 40186d3d4..8479c7208 100644 --- a/ip/iptunnel.c +++ b/ip/iptunnel.c @@ -240,8 +240,9 @@ static int parse_args(int argc, char **argv, int cmd, struct ip_tunnel_parm *p) } } - if (p->iph.protocol == IPPROTO_IPIP || p->iph.protocol == IPPROTO_IPV6) { - if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) { + if ((p->i_flags & GRE_KEY) || (p->o_flags & GRE_KEY)) { + if (!(p->i_flags & VTI_ISVTI) && + (p->iph.protocol != IPPROTO_GRE)) { fprintf(stderr, "Keys are not allowed with ipip and sit tunnels\n"); return -1; }