Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libnl: nla_put_s64(): align on a 64-bit area

nla_data() is now aligned on a 64-bit area.
In fact, there is no user of this function.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Nicolas Dichtel and committed by
David S. Miller
756a2f59 e9bbe898

+7 -4
+7 -4
include/net/netlink.h
··· 102 102 * nla_put_s8(skb, type, value) add s8 attribute to skb 103 103 * nla_put_s16(skb, type, value) add s16 attribute to skb 104 104 * nla_put_s32(skb, type, value) add s32 attribute to skb 105 - * nla_put_s64(skb, type, value) add s64 attribute to skb 105 + * nla_put_s64(skb, type, value, 106 + * padattr) add s64 attribute to skb 106 107 * nla_put_string(skb, type, str) add string attribute to skb 107 108 * nla_put_flag(skb, type) add flag attribute to skb 108 109 * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb ··· 930 929 } 931 930 932 931 /** 933 - * nla_put_s64 - Add a s64 netlink attribute to a socket buffer 932 + * nla_put_s64 - Add a s64 netlink attribute to a socket buffer and align it 934 933 * @skb: socket buffer to add attribute to 935 934 * @attrtype: attribute type 936 935 * @value: numeric value 936 + * @padattr: attribute type for the padding 937 937 */ 938 - static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value) 938 + static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value, 939 + int padattr) 939 940 { 940 - return nla_put(skb, attrtype, sizeof(s64), &value); 941 + return nla_put_64bit(skb, attrtype, sizeof(s64), &value, padattr); 941 942 } 942 943 943 944 /**