ba7dcc58f3f0e77f50f628966fb5f64dff078315
[cascardo/ovs.git] / datapath / linux / compat / include / net / ip6_route.h
1 #ifndef __NET_IP6_ROUTE_WRAPPER
2 #define __NET_IP6_ROUTE_WRAPPER
3
4 #include <net/route.h>
5 #include <net/ip.h>                /* For OVS_VPORT_OUTPUT_PARAMS */
6 #include <net/ipv6.h>
7
8 #include_next<net/ip6_route.h>
9
10 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
11
12 static inline
13 struct dst_entry *rpl_ip6_route_output(struct net *net, const struct sock *sk,
14                                    struct flowi6 *fl6)
15 {
16         struct flowi fl;
17
18         memset(&fl, 0, sizeof(fl));
19         fl.oif = fl6->flowi6_oif;
20         fl.fl6_dst = fl6->daddr;
21         fl.fl6_src = fl6->saddr;
22         fl.mark = fl6->flowi6_mark;
23         fl.proto = fl6->flowi6_proto;
24
25         return ip6_route_output(net, (struct sock *) sk, &fl);
26 }
27 #define ip6_route_output rpl_ip6_route_output
28
29 #define ip6_dst_hoplimit(dst) dst_metric(dst, RTAX_HOPLIMIT)
30
31 #endif /* 2.6.39 */
32
33 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
34 static inline int rpl_ip6_fragment(struct sock *sk, struct sk_buff *skb,
35                                    int (*output)(struct sk_buff *))
36 {
37         kfree_skb(skb);
38         return -ENOTSUPP;
39 }
40 #define ip6_fragment rpl_ip6_fragment
41 #elif defined(OVS_FRAGMENT_BACKPORT)
42 int rpl_ip6_fragment(struct sock *sk, struct sk_buff *skb,
43                      int (*output)(OVS_VPORT_OUTPUT_PARAMS));
44 #define ip6_fragment rpl_ip6_fragment
45 #endif /* OVS_FRAGMENT_BACKPORT */
46
47 #endif /* _NET_IP6_ROUTE_WRAPPER */