diff options
Diffstat (limited to 'backport-include/linux/rtnetlink.h')
-rw-r--r-- | backport-include/linux/rtnetlink.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/backport-include/linux/rtnetlink.h b/backport-include/linux/rtnetlink.h new file mode 100644 index 0000000..56ba9f6 --- /dev/null +++ b/backport-include/linux/rtnetlink.h @@ -0,0 +1,24 @@ +#ifndef __BACKPORT_LINUX_RTNETLINK_H +#define __BACKPORT_LINUX_RTNETLINK_H +#include_next <linux/rtnetlink.h> + +#ifndef rtnl_dereference +#define rtnl_dereference(p) \ + rcu_dereference_protected(p, lockdep_rtnl_is_held()) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) +#ifdef CONFIG_PROVE_LOCKING +/* + * Obviously, this is wrong. But the base kernel will have rtnl_mutex + * declared static, with no way to access it. I think this is the best + * we can do... + */ +static inline int lockdep_rtnl_is_held(void) +{ + return 1; +} +#endif /* #ifdef CONFIG_PROVE_LOCKING */ +#endif /* < 2.6.34 */ + +#endif /* __BACKPORT_LINUX_RTNETLINK_H */ |