From: Thomas Graf Date: Wed, 3 Dec 2014 12:02:31 +0000 (+0100) Subject: datapath: Check if nla_is_last() is available in X-Git-Tag: v2.4.0~809 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=0fcc086dc7da3fa832af11fa4a8ca24afb78cbe0 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 --- 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;