]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iptunnel: Allow GRE_KEY for vti interface
authorHangbin Liu <liuhangbin@gmail.com>
Thu, 5 Dec 2013 16:19:01 +0000 (00:19 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Sat, 28 Dec 2013 19:29:53 +0000 (11:29 -0800)
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 <liuhangbin@gmail.com>
ip/iptunnel.c

index 40186d3d4d57c2fd33fb8e62fc0b2ae286622469..8479c7208d225d8eb34e56d513963731f25c9aeb 100644 (file)
@@ -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;
                }