datapath: Add support for lwtunnel
[cascardo/ovs.git] / datapath / linux / compat / include / net / ip6_tunnel.h
1 #ifndef _NET_IP6_TUNNEL_WRAPER_H
2 #define _NET_IP6_TUNNEL_WRAPER_H
3
4 #include <linux/ipv6.h>
5 #include <linux/netdevice.h>
6 #include <linux/if_tunnel.h>
7 #include <linux/ip6_tunnel.h>
8 #include_next <net/ip6_tunnel.h>
9
10 #include "gso.h"
11
12 #define ip6tunnel_xmit rpl_ip6tunnel_xmit
13 static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb,
14                                   struct net_device *dev)
15 {
16         int pkt_len, err;
17
18         pkt_len = skb->len - skb_inner_network_offset(skb);
19         /* TODO: Fix GSO for ipv6 */
20 #ifdef HAVE_IP6_LOCAL_OUT_SK
21         err = ip6_local_out_sk(sk, skb);
22 #else
23         err = ip6_local_out(skb);
24 #endif
25         if (net_xmit_eval(err) != 0)
26                 pkt_len = net_xmit_eval(err);
27         else
28                 pkt_len = err;
29
30         iptunnel_xmit_stats(pkt_len, &dev->stats, (struct pcpu_sw_netstats __percpu *)dev->tstats);
31 }
32
33 #endif