Merge citrix branch into master.
[sliver-openvswitch.git] / datapath / linux-2.6 / compat-2.6 / include / linux / rtnetlink.h
1 #ifndef __RTNETLINK_WRAPPER_H
2 #define __RTNETLINK_WRAPPER_H 1
3
4 #include_next <linux/rtnetlink.h>
5
6 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
7 static inline void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid,
8                               u32 group, struct nlmsghdr *nlh, gfp_t flags)
9 {
10         BUG_ON(nlh);            /* not implemented */
11         if (group) {
12                 /* errors reported via destination sk->sk_err */
13                 nlmsg_multicast(rtnl, skb, 0, group);
14         }
15 }
16
17 static inline void rtnl_set_sk_err(struct net *net, u32 group, int error)
18 {
19         netlink_set_err(rtnl, 0, group, error);
20 }
21 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
22 /* No 'net' parameter in these versions. */
23 #define rtnl_notify(skb, net, pid, group, nlh, flags) \
24         ((void) (net), (void) rtnl_notify(skb, pid, group, nlh, flags))
25 #define rtnl_set_sk_err(net, group, error) \
26         ((void) (net), rtnl_set_sk_err(group, error))
27 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
28 /* Make the return type effectively 'void' to match Linux 2.6.30+. */
29 #define rtnl_notify(skb, net, pid, group, nlh, flags) \
30         ((void) rtnl_notify(skb, net, pid, group, nlh, flags))
31 #endif
32
33 #endif /* linux/rtnetlink.h wrapper */