From: Vladimir Sokolovsky Date: Wed, 22 Feb 2012 10:50:32 +0000 (+0200) Subject: compat: add net/dst.h stub for Linux 3.1 and older X-Git-Tag: compat-2012-07-02~19 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a27eb3eead864baaf9648072ebfd47fb85652766;p=~emulex%2Ftmp%2Fcompat%2F.git compat: add net/dst.h stub for Linux 3.1 and older Signed-off-by: Vladimir Sokolovsky --- diff --git a/include/net/dst.h b/include/net/dst.h new file mode 100644 index 0000000..f943fc4 --- /dev/null +++ b/include/net/dst.h @@ -0,0 +1,27 @@ +#ifndef _COMPAT_NET_DST_H +#define _COMPAT_NET_DST_H 1 + +#include + +#if (LINUX_VERSION_CODE > KERNEL_VERSION(3,1,0)) +#include +#else /* (LINUX_VERSION_CODE > KERNEL_VERSION(3,1,0)) */ +#include_next + +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 */