datapath: Check if nla_is_last() is available in <net/netlink.h>
authorThomas Graf <tgraf@noironetworks.com>
Wed, 3 Dec 2014 12:02:31 +0000 (13:02 +0100)
committerPravin B Shelar <pshelar@nicira.com>
Wed, 10 Dec 2014 01:09:26 +0000 (17:09 -0800)
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 <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
acinclude.m4
datapath/linux/compat/include/net/netlink.h

index 3d0eef1..1c0ed69 100644 (file)
@@ -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])
 
index 9b83e17..2122ace 100644 (file)
@@ -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;