* Only function that do not depend on ip_tunnel structure can
* be used. Those needs to be explicitly defined in this header file. */
#include_next <net/ip_tunnels.h>
-#endif
+#else
#include <linux/if_tunnel.h>
#include <linux/types.h>
#include <net/ip.h>
#include <net/rtnetlink.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
#define __iptunnel_pull_header rpl___iptunnel_pull_header
int rpl___iptunnel_pull_header(struct sk_buff *skb, int hdr_len,
__be16 inner_proto, bool raw_proto, bool xnet);
{
return rpl___iptunnel_pull_header(skb, hdr_len, inner_proto, false, xnet);
}
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
int ovs_iptunnel_handle_offloads(struct sk_buff *skb,
bool csum_help, int gso_type_mask,
void (*fix_segment)(struct sk_buff *));
struct sk_buff *rpl_iptunnel_handle_offloads(struct sk_buff *skb,
bool csum_help,
int gso_type_mask);
-#else
-
-#define ovs_iptunnel_handle_offloads(skb, csum_help, gso_type_mask, fix_segment) \
- iptunnel_handle_offloads(skb, gso_type_mask)
-#endif
#define iptunnel_xmit rpl_iptunnel_xmit
void rpl_iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
#define skb_is_encapsulated ovs_skb_is_encapsulated
bool ovs_skb_is_encapsulated(struct sk_buff *skb);
-#ifndef USE_UPSTREAM_TUNNEL
/* Used to memset ip_tunnel padding. */
#define IP_TUNNEL_KEY_SIZE offsetofend(struct ip_tunnel_key, tp_dst)
#define ip_tunnel_get_link_net rpl_ip_tunnel_get_link_net
struct net *rpl_ip_tunnel_get_link_net(const struct net_device *dev);
-#endif /* USE_UPSTREAM_TUNNEL */
#ifndef HAVE___IP_TUNNEL_CHANGE_MTU
#define __ip_tunnel_change_mtu rpl___ip_tunnel_change_mtu
skb->encapsulation = 0;
return 0;
}
+#endif /* USE_UPSTREAM_TUNNEL */
#endif /* __NET_IP_TUNNELS_H */
#ifdef USE_UPSTREAM_TUNNEL
#include_next <net/udp_tunnel.h>
+/* this is to handle the return type change in handle-offload
+ * functions.
+ */
+static inline int
+rpl_udp_tunnel_handle_offloads(struct sk_buff *skb, bool udp_csum,
+ bool is_vxlan)
+{
+ if (skb_is_gso(skb) && skb_is_encapsulated(skb)) {
+ return -ENOSYS;
+ }
+ return udp_tunnel_handle_offloads(skb, udp_csum);
+}
+
#else
#include <net/addrconf.h>
skb_shinfo(skb)->gso_type |= uh->check ?
SKB_GSO_UDP_TUNNEL_CSUM : SKB_GSO_UDP_TUNNEL;
}
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
-/* this is to handle the return type change in handle-offload
- * functions.
- */
-static inline int
-rpl_udp_tunnel_handle_offloads(struct sk_buff *skb, bool udp_csum,
- bool is_vxlan)
-{
- if (skb_is_gso(skb) && skb_is_encapsulated(skb)) {
- return -ENOSYS;
- }
- return udp_tunnel_handle_offloads(skb, udp_csum);
-}
-#else
void ovs_udp_gso(struct sk_buff *skb);
void ovs_udp_csum_gso(struct sk_buff *skb);
return ovs_iptunnel_handle_offloads(skb, udp_csum, type, fix_segment);
}
-#endif
+#endif /* USE_UPSTREAM_TUNNEL */
#define udp_tunnel_handle_offloads rpl_udp_tunnel_handle_offloads
-
static inline void ovs_udp_tun_rx_dst(struct ip_tunnel_info *info,
struct sk_buff *skb,
unsigned short family,
#include "gso.h"
#include "vport-netdev.h"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
+#ifndef USE_UPSTREAM_TUNNEL
void rpl_iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
__be32 src, __be32 dst, __u8 proto, __u8 tos, __u8 ttl,
__be16 df, bool xnet)
iptunnel_xmit_stats(dev, pkt_len);
}
EXPORT_SYMBOL_GPL(rpl_iptunnel_xmit);
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
int ovs_iptunnel_handle_offloads(struct sk_buff *skb,
bool csum_help, int gso_type_mask,
void (*fix_segment)(struct sk_buff *))
return iptunnel_pull_offloads(skb);
}
EXPORT_SYMBOL_GPL(rpl___iptunnel_pull_header);
-
-#endif
+#endif /* USE_UPSTREAM_TUNNEL */
bool ovs_skb_is_encapsulated(struct sk_buff *skb)
{