From patchwork Fri Apr 22 15:31:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dichtel X-Patchwork-Id: 613718 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qs03Y6291z9t5c for ; Sat, 23 Apr 2016 01:32:09 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754461AbcDVPcF (ORCPT ); Fri, 22 Apr 2016 11:32:05 -0400 Received: from host.76.145.23.62.rev.coltfrance.com ([62.23.145.76]:53585 "EHLO proxy.6wind.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753993AbcDVPcE (ORCPT ); Fri, 22 Apr 2016 11:32:04 -0400 Received: from elsass.dev.6wind.com (unknown [10.16.0.149]) by proxy.6wind.com (Postfix) with ESMTPS id 4DC5426C7E; Fri, 22 Apr 2016 17:30:19 +0200 (CEST) Received: from root by elsass.dev.6wind.com with local (Exim 4.80) (envelope-from ) id 1atd3Y-00011u-41; Fri, 22 Apr 2016 17:31:44 +0200 From: Nicolas Dichtel To: netdev@vger.kernel.org Cc: davem@davemloft.net, linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org, aar@pengutronix.de, pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu, pshelar@nicira.com, kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, netfilter-devel@vger.kernel.org, dev@openvswitch.org, steffen.klassert@secunet.com, herbert@gondor.apana.org.au, bsingharora@gmail.com, Nicolas Dichtel Subject: [PATCH net-next 7/9] libnl: add nla_put_u64_64bit() helper Date: Fri, 22 Apr 2016 17:31:22 +0200 Message-Id: <1461339084-3849-8-git-send-email-nicolas.dichtel@6wind.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1461339084-3849-1-git-send-email-nicolas.dichtel@6wind.com> References: <1461339084-3849-1-git-send-email-nicolas.dichtel@6wind.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org With this function, nla_data() is aligned on a 64-bit area. Signed-off-by: Nicolas Dichtel --- include/net/netlink.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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