]> git.proxmox.com Git - mirror_ovs.git/blame - datapath/compat.h
compat: Use nla_parse deprecated functions
[mirror_ovs.git] / datapath / compat.h
CommitLineData
9cb8d24d 1/*
e23775f2 2 * Copyright (c) 2007-2015 Nicira, Inc.
9cb8d24d 3 *
a9a29d22
JG
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.
7 *
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.
12 *
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
16 * 02110-1301, USA
9cb8d24d
JG
17 */
18
19#ifndef COMPAT_H
20#define COMPAT_H 1
21
6c5d24af
PS
22#include <linux/in.h>
23#include <linux/in_route.h>
9cb8d24d 24#include <linux/netlink.h>
595e069a 25#include <net/ip.h>
6c5d24af
PS
26#include <net/route.h>
27#include <net/xfrm.h>
73b09aff 28#include <net/netfilter/ipv6/nf_defrag_ipv6.h>
cb2a5486 29#include <net/netfilter/nf_conntrack_count.h>
6c5d24af 30
1556fcca
YHW
31/* Fix grsecurity patch compilation issue. */
32#ifdef CONSTIFY_PLUGIN
33#include <linux/cache.h>
34#undef __read_mostly
35#define __read_mostly
36#endif
37
8063e095
PS
38/* Even though vanilla 3.10 kernel has grp->id, RHEL 7 kernel is missing
39 * this field. */
13dd4a97 40#ifdef HAVE_GENL_MULTICAST_GROUP_WITH_ID
cb25142c 41#define GROUP_ID(grp) ((grp)->id)
13dd4a97
JS
42#else
43#define GROUP_ID(grp) 0
14002a59
PS
44#endif
45
e4e04c3b
JS
46#ifdef HAVE_NF_IPV6_OPS_FRAGMENT
47static inline int __init ip6_output_init(void) { return 0; }
48static inline void ip6_output_exit(void) { }
49#else
73b09aff
JS
50int __init ip6_output_init(void);
51void ip6_output_exit(void);
e4e04c3b 52#endif
73b09aff 53
595e069a
JS
54static inline int __init compat_init(void)
55{
73b09aff
JS
56 int err;
57
58 err = ipfrag_init();
59 if (err)
60 return err;
61
62 err = nf_ct_frag6_init();
63 if (err)
64 goto error_ipfrag_exit;
65
66 err = ip6_output_init();
67 if (err)
68 goto error_frag6_exit;
69
cb2a5486
YHW
70 err = rpl_nf_conncount_modinit();
71 if (err)
72 goto error_nf_conncount_exit;
73
73b09aff
JS
74 return 0;
75
cb2a5486
YHW
76error_nf_conncount_exit:
77 rpl_nf_conncount_modexit();
73b09aff
JS
78error_frag6_exit:
79 nf_ct_frag6_cleanup();
80error_ipfrag_exit:
81 rpl_ipfrag_fini();
82 return err;
595e069a
JS
83}
84static inline void compat_exit(void)
85{
cb2a5486 86 rpl_nf_conncount_modexit();
73b09aff
JS
87 ip6_output_exit();
88 nf_ct_frag6_cleanup();
595e069a
JS
89 rpl_ipfrag_fini();
90}
595e069a 91
9cb8d24d 92#endif /* compat.h */