@@ -897,6 +897,9 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
[OVS_DEFINE([HAVE_VOID_NDO_GET_STATS64])])
OVS_GREP_IFELSE([$KSRC/include/linux/timer.h], [init_timer_deferrable],
[OVS_DEFINE([HAVE_INIT_TIMER_DEFERRABLE])])
+ OVS_FIND_PARAM_IFELSE([$KSRC/include/net/ip_tunnels.h],
+ [ip_tunnel_info_opts_set], [flags],
+ [OVS_DEFINE([HAVE_IP_TUNNEL_INFO_OPTS_SET_FLAGS])])
if cmp -s datapath/linux/kcompat.h.new \
datapath/linux/kcompat.h >/dev/null 2>&1; then
@@ -13,7 +13,21 @@
#define TUNNEL_ERSPAN_OPT __cpu_to_be16(0x4000)
#endif
#define ovs_ip_tunnel_encap ip_tunnel_encap
-#else
+
+#ifndef HAVE_IP_TUNNEL_INFO_OPTS_SET_FLAGS
+static inline void rpl_ip_tunnel_info_opts_set(struct ip_tunnel_info *info,
+ const void *from, int len,
+ __be16 flags)
+{
+ memcpy(ip_tunnel_info_opts(info), from, len);
+ info->options_len = len;
+ info->key.tun_flags |= flags;
+}
+
+#define ip_tunnel_info_opts_set rpl_ip_tunnel_info_opts_set
+#endif
+
+#else /* USE_UPSTREAM_TUNNEL */
#include <linux/if_tunnel.h>
#include <linux/types.h>