102102 * nla_put_s8(skb, type, value) add s8 attribute to skb
103103 * nla_put_s16(skb, type, value) add s16 attribute to skb
104104 * 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
106107 * nla_put_string(skb, type, str) add string attribute to skb
107108 * nla_put_flag(skb, type) add flag attribute to skb
108- * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb
109+ * nla_put_msecs(skb, type, jiffies,
110+ * padattr) add msecs attribute to skb
109111 * nla_put_in_addr(skb, type, addr) add IPv4 address attribute to skb
110112 * nla_put_in6_addr(skb, type, addr) add IPv6 address attribute to skb
111113 *
@@ -856,36 +858,56 @@ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
856858}
857859
858860/**
859- * nla_put_be64 - Add a __be64 netlink attribute to a socket buffer
861+ * nla_put_u64_64bit - Add a u64 netlink attribute to a skb and align it
860862 * @skb: socket buffer to add attribute to
861863 * @attrtype: attribute type
862864 * @value: numeric value
865+ * @padattr: attribute type for the padding
863866 */
864- static inline int nla_put_be64 (struct sk_buff * skb , int attrtype , __be64 value )
867+ static inline int nla_put_u64_64bit (struct sk_buff * skb , int attrtype ,
868+ u64 value , int padattr )
865869{
866- return nla_put (skb , attrtype , sizeof (__be64 ), & value );
870+ return nla_put_64bit (skb , attrtype , sizeof (u64 ), & value , padattr );
867871}
868872
869873/**
870- * nla_put_net64 - Add 64-bit network byte order netlink attribute to a socket buffer
874+ * nla_put_be64 - Add a __be64 netlink attribute to a socket buffer and align it
871875 * @skb: socket buffer to add attribute to
872876 * @attrtype: attribute type
873877 * @value: numeric value
878+ * @padattr: attribute type for the padding
874879 */
875- static inline int nla_put_net64 (struct sk_buff * skb , int attrtype , __be64 value )
880+ static inline int nla_put_be64 (struct sk_buff * skb , int attrtype , __be64 value ,
881+ int padattr )
876882{
877- return nla_put_be64 (skb , attrtype | NLA_F_NET_BYTEORDER , value );
883+ return nla_put_64bit (skb , attrtype , sizeof ( __be64 ), & value , padattr );
878884}
879885
880886/**
881- * nla_put_le64 - Add a __le64 netlink attribute to a socket buffer
887+ * nla_put_net64 - Add 64-bit network byte order nlattr to a skb and align it
882888 * @skb: socket buffer to add attribute to
883889 * @attrtype: attribute type
884890 * @value: numeric value
891+ * @padattr: attribute type for the padding
885892 */
886- static inline int nla_put_le64 (struct sk_buff * skb , int attrtype , __le64 value )
893+ static inline int nla_put_net64 (struct sk_buff * skb , int attrtype , __be64 value ,
894+ int padattr )
887895{
888- return nla_put (skb , attrtype , sizeof (__le64 ), & value );
896+ return nla_put_be64 (skb , attrtype | NLA_F_NET_BYTEORDER , value ,
897+ padattr );
898+ }
899+
900+ /**
901+ * nla_put_le64 - Add a __le64 netlink attribute to a socket buffer and align it
902+ * @skb: socket buffer to add attribute to
903+ * @attrtype: attribute type
904+ * @value: numeric value
905+ * @padattr: attribute type for the padding
906+ */
907+ static inline int nla_put_le64 (struct sk_buff * skb , int attrtype , __le64 value ,
908+ int padattr )
909+ {
910+ return nla_put_64bit (skb , attrtype , sizeof (__le64 ), & value , padattr );
889911}
890912
891913/**
@@ -922,14 +944,16 @@ static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value)
922944}
923945
924946/**
925- * nla_put_s64 - Add a s64 netlink attribute to a socket buffer
947+ * nla_put_s64 - Add a s64 netlink attribute to a socket buffer and align it
926948 * @skb: socket buffer to add attribute to
927949 * @attrtype: attribute type
928950 * @value: numeric value
951+ * @padattr: attribute type for the padding
929952 */
930- static inline int nla_put_s64 (struct sk_buff * skb , int attrtype , s64 value )
953+ static inline int nla_put_s64 (struct sk_buff * skb , int attrtype , s64 value ,
954+ int padattr )
931955{
932- return nla_put (skb , attrtype , sizeof (s64 ), & value );
956+ return nla_put_64bit (skb , attrtype , sizeof (s64 ), & value , padattr );
933957}
934958
935959/**
@@ -955,16 +979,18 @@ static inline int nla_put_flag(struct sk_buff *skb, int attrtype)
955979}
956980
957981/**
958- * nla_put_msecs - Add a msecs netlink attribute to a socket buffer
982+ * nla_put_msecs - Add a msecs netlink attribute to a skb and align it
959983 * @skb: socket buffer to add attribute to
960984 * @attrtype: attribute type
961985 * @njiffies: number of jiffies to convert to msecs
986+ * @padattr: attribute type for the padding
962987 */
963988static inline int nla_put_msecs (struct sk_buff * skb , int attrtype ,
964- unsigned long njiffies )
989+ unsigned long njiffies , int padattr )
965990{
966991 u64 tmp = jiffies_to_msecs (njiffies );
967- return nla_put (skb , attrtype , sizeof (u64 ), & tmp );
992+
993+ return nla_put_64bit (skb , attrtype , sizeof (u64 ), & tmp , padattr );
968994}
969995
970996/**
0 commit comments