提交 73520786 编写于 作者: N Nicolas Dichtel 提交者: David S. Miller

libnl: add nla_put_u64_64bit() helper

With this function, nla_data() is aligned on a 64-bit area.
Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2175d87c
...@@ -857,6 +857,19 @@ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) ...@@ -857,6 +857,19 @@ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
return nla_put(skb, attrtype, sizeof(u64), &value); return nla_put(skb, attrtype, sizeof(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 * nla_put_be64 - Add a __be64 netlink attribute to a socket buffer and align it
* @skb: socket buffer to add attribute to * @skb: socket buffer to add attribute to
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册