]>
git.proxmox.com Git - mirror_ovs.git/blob - datapath/compat.h
2 * Copyright (c) 2007-2015 Nicira, Inc.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 2 of the GNU General Public
6 * License as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 #include <linux/in_route.h>
24 #include <linux/netlink.h>
26 #include <net/route.h>
28 #include <net/netfilter/ipv6/nf_defrag_ipv6.h>
30 #ifdef HAVE_GENL_MULTICAST_GROUP_WITH_ID
31 #define GROUP_ID(grp) ((grp)->id)
33 #define GROUP_ID(grp) 0
36 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
37 #define rt_dst(rt) (rt->dst)
39 #define rt_dst(rt) (rt->u.dst)
42 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
43 #define inet_sport(sk) (inet_sk(sk)->sport)
45 #define inet_sport(sk) (inet_sk(sk)->inet_sport)
48 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
49 static inline bool skb_encapsulation(struct sk_buff
*skb
)
51 return skb
->encapsulation
;
54 #define skb_encapsulation(skb) false
57 #ifdef OVS_FRAGMENT_BACKPORT
58 int __init
ip6_output_init(void);
59 void ip6_output_exit(void);
61 static inline int __init
compat_init(void)
69 err
= nf_ct_frag6_init();
71 goto error_ipfrag_exit
;
73 err
= ip6_output_init();
75 goto error_frag6_exit
;
80 nf_ct_frag6_cleanup();
85 static inline void compat_exit(void)
88 nf_ct_frag6_cleanup();
92 static inline int __init
compat_init(void) { return 0; }
93 static inline void compat_exit(void) { }