rm -f datapath/linux-2.6/kcompat.h.new
mkdir -p datapath/linux-2.6
: > datapath/linux-2.6/kcompat.h.new
+ OVS_GREP_IFELSE([$KSRC26/include/linux/types.h], [bool],
+ [OVS_DEFINE([HAVE_BOOL_TYPE])])
OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_transport_header],
[OVS_DEFINE([HAVE_SKBUFF_HEADER_HELPERS])])
OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [raw],
[OVS_DEFINE([HAVE_CSUM_UNFOLD])])
OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_cow],
[OVS_DEFINE([HAVE_SKB_COW])])
+ OVS_GREP_IFELSE([$KSRC26/include/net/netlink.h], [nla_get_be16],
+ [OVS_DEFINE([HAVE_NLA_GET_BE16])])
+ OVS_GREP_IFELSE([$KSRC26/include/linux/in.h], [ipv4_is_multicast],
+ [OVS_DEFINE([HAVE_IPV4_IS_MULTICAST])])
# Check for the proto_data_valid member in struct sk_buff. The [^@]
# is necessary because some versions of this header remove the
# member but retain the kerneldoc comment that describes it (which
#include_next <linux/in.h>
-#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+#ifndef HAVE_IPV4_IS_MULTICAST
static inline bool ipv4_is_multicast(__be32 addr)
{
return (addr & htonl(0xf0000000)) == htonl(0xe0000000);
}
-#endif /* linux kernel < 2.6.25 */
+#endif /* !HAVE_IPV4_IS_MULTICAST */
#endif
}
#endif /* !HAVE_NLA_NUL_STRING */
+
+#ifndef NLA_PUT_BE16
+#define NLA_PUT_BE16(skb, attrtype, value) \
+ NLA_PUT_TYPE(skb, __be16, attrtype, value)
+#endif /* !NLA_PUT_BE16 */
+
+
+#ifndef HAVE_NLA_GET_BE16
+/**
+ * nla_get_be16 - return payload of __be16 attribute
+ * @nla: __be16 netlink attribute
+ */
+static inline __be16 nla_get_be16(struct nlattr *nla)
+{
+ return *(__be16 *) nla_data(nla);
+}
+#endif /* !HAVE_NLA_GET_BE16 */
+
#endif /* net/netlink.h */