From 77a865b5b3ac476e05ff80f3c10d86686285c0da Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Wed, 6 Aug 2014 13:23:12 +0200 Subject: [PATCH] Disable new-style tunnel creation for older kernels Signed-off-by: Steven Barth --- system-linux.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/system-linux.c b/system-linux.c index 2d65cef..2a281cc 100644 --- a/system-linux.c +++ b/system-linux.c @@ -1654,6 +1654,7 @@ static int tunnel_ioctl(const char *name, int cmd, void *p) return ioctl(sock_ioctl, cmd, &ifr); } +#ifdef IFLA_IPTUN_MAX static int system_add_gre_tunnel(const char *name, const char *kind, const unsigned int link, struct blob_attr **tb, bool v6) { @@ -1796,6 +1797,7 @@ failure: nlmsg_free(nlm); return ret; } +#endif static int __system_del_ip_tunnel(const char *name, struct blob_attr **tb) { @@ -1935,6 +1937,7 @@ int system_add_ip_tunnel(const char *name, struct blob_attr *attr) } } #endif +#ifdef IFLA_IPTUN_MAX } else if (!strcmp(str, "ipip6")) { struct nl_msg *nlm = nlmsg_alloc_simple(RTM_NEWLINK, NLM_F_REQUEST | NLM_F_REPLACE | NLM_F_CREATE); @@ -2045,6 +2048,7 @@ failure: return system_add_gre_tunnel(name, "ip6gre", link, tb, true); } else if (!strcmp(str, "gretapip6")) { return system_add_gre_tunnel(name, "ip6gretap", link, tb, true); +#endif } else return -EINVAL; -- 2.25.1