libnl: nla_put_msecs(): align on a 64-bit area
nla_data() is now aligned on a 64-bit area. Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
756a2f59b7
commit
2175d87cc3
@@ -106,7 +106,8 @@
|
||||
* padattr) add s64 attribute to skb
|
||||
* nla_put_string(skb, type, str) add string attribute to skb
|
||||
* nla_put_flag(skb, type) add flag attribute to skb
|
||||
* nla_put_msecs(skb, type, jiffies) add msecs attribute to skb
|
||||
* nla_put_msecs(skb, type, jiffies,
|
||||
* padattr) add msecs attribute to skb
|
||||
* nla_put_in_addr(skb, type, addr) add IPv4 address attribute to skb
|
||||
* nla_put_in6_addr(skb, type, addr) add IPv6 address attribute to skb
|
||||
*
|
||||
@@ -965,16 +966,18 @@ static inline int nla_put_flag(struct sk_buff *skb, int attrtype)
|
||||
}
|
||||
|
||||
/**
|
||||
* nla_put_msecs - Add a msecs netlink attribute to a socket buffer
|
||||
* nla_put_msecs - Add a msecs netlink attribute to a skb and align it
|
||||
* @skb: socket buffer to add attribute to
|
||||
* @attrtype: attribute type
|
||||
* @njiffies: number of jiffies to convert to msecs
|
||||
* @padattr: attribute type for the padding
|
||||
*/
|
||||
static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
|
||||
unsigned long njiffies)
|
||||
unsigned long njiffies, int padattr)
|
||||
{
|
||||
u64 tmp = jiffies_to_msecs(njiffies);
|
||||
return nla_put(skb, attrtype, sizeof(u64), &tmp);
|
||||
|
||||
return nla_put_64bit(skb, attrtype, sizeof(u64), &tmp, padattr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user