summaryrefslogtreecommitdiff
path: root/include/net/netlink.h
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2016-04-22 18:31:22 +0300
committerDavid S. Miller <davem@davemloft.net>2016-04-24 03:13:25 +0300
commit73520786b0793c612ef4de3e9addb2ec411bea20 (patch)
tree122a932c7296f2cd9e9b763e2fb3ad74b74621f5 /include/net/netlink.h
parent2175d87cc3561c02e605bc8ac81ee5d875a51b9e (diff)
downloadlinux-73520786b0793c612ef4de3e9addb2ec411bea20.tar.xz
libnl: add nla_put_u64_64bit() helper
With this function, nla_data() is aligned on a 64-bit area. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/netlink.h')
-rw-r--r--include/net/netlink.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 113b483b6ee8..e589cb3dccee 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -858,6 +858,19 @@ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
}
/**
+ * nla_put_u64_64bit - Add a u64 netlink attribute to a skb and align it
+ * @skb: socket buffer to add attribute to
+ * @attrtype: attribute type
+ * @value: numeric value
+ * @padattr: attribute type for the padding
+ */
+static inline int nla_put_u64_64bit(struct sk_buff *skb, int attrtype,
+ u64 value, int padattr)
+{
+ return nla_put_64bit(skb, attrtype, sizeof(u64), &value, padattr);
+}
+
+/**
* nla_put_be64 - Add a __be64 netlink attribute to a socket buffer and align it
* @skb: socket buffer to add attribute to
* @attrtype: attribute type