From 0fcc086dc7da3fa832af11fa4a8ca24afb78cbe0 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Wed, 3 Dec 2014 13:02:31 +0100 Subject: [PATCH] datapath: Check if nla_is_last() is available in nla_is_last() is not available in 3.18, it's only in net-next. Convert to grep based to check to account for distribution backports. Fixes: 684b5f ("datapath: Rename last_action() as nla_is_last() and move to netlink.h") Signed-off-by: Thomas Graf Acked-by: Pravin B Shelar --- acinclude.m4 | 1 + datapath/linux/compat/include/net/netlink.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 3d0eef118..1c0ed6927 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -370,6 +370,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be32]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_put_be64]) OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_find_nested]) + OVS_GREP_IFELSE([$KSRC/include/net/netlink.h], [nla_is_last]) OVS_GREP_IFELSE([$KSRC/include/net/sctp/checksum.h], [sctp_compute_cksum]) diff --git a/datapath/linux/compat/include/net/netlink.h b/datapath/linux/compat/include/net/netlink.h index 9b83e171b..2122acef3 100644 --- a/datapath/linux/compat/include/net/netlink.h +++ b/datapath/linux/compat/include/net/netlink.h @@ -63,7 +63,7 @@ static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype) } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) +#ifndef HAVE_NLA_IS_LAST static inline bool nla_is_last(const struct nlattr *nla, int rem) { return nla->nla_len == rem; -- 2.20.1