]> git.openfabrics.org - ~emulex/tmp/compat/.git/commitdiff
compat: add net/dst.h stub for Linux 3.1 and older
authorVladimir Sokolovsky <vlad@mellanox.com>
Wed, 22 Feb 2012 10:50:32 +0000 (12:50 +0200)
committerVladimir Sokolovsky <vlad@mellanox.com>
Wed, 22 Feb 2012 17:09:02 +0000 (19:09 +0200)
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
include/net/dst.h [new file with mode: 0644]

diff --git a/include/net/dst.h b/include/net/dst.h
new file mode 100644 (file)
index 0000000..f943fc4
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _COMPAT_NET_DST_H
+#define _COMPAT_NET_DST_H 1
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(3,1,0))
+#include <net/dst.h>
+#else /* (LINUX_VERSION_CODE > KERNEL_VERSION(3,1,0)) */
+#include_next <net/dst.h>
+
+static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst)
+{
+       return dst->neighbour;
+}
+
+static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh)
+{
+       dst->neighbour = neigh;
+}
+
+static inline struct neighbour *dst_get_neighbour_raw(struct dst_entry *dst)
+{
+       return rcu_dereference_raw(dst->neighbour);
+}
+#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(3,1,0)) */
+
+#endif /* _COMPAT_NET_DST_H */