From patchwork Wed Apr 20 08:57:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dichtel X-Patchwork-Id: 612551 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 3qqbQM5y72z9t3q for ; Wed, 20 Apr 2016 18:58:35 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933102AbcDTI57 (ORCPT ); Wed, 20 Apr 2016 04:57:59 -0400 Received: from host.76.145.23.62.rev.coltfrance.com ([62.23.145.76]:56444 "EHLO proxy.6wind.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932727AbcDTI5w (ORCPT ); Wed, 20 Apr 2016 04:57:52 -0400 Received: from schnaps.dev.6wind.com (unknown [10.16.0.7]) by proxy.6wind.com (Postfix) with ESMTPS id 2185F249B4; Wed, 20 Apr 2016 10:57:07 +0200 (CEST) Received: from root by schnaps.dev.6wind.com with local (Exim 4.80) (envelope-from ) id 1asnx4-0001LC-2N; Wed, 20 Apr 2016 10:57:38 +0200 From: Nicolas Dichtel To: netdev@vger.kernel.org Cc: davem@davemloft.net, roopa@cumulusnetworks.com, eric.dumazet@gmail.com, tgraf@suug.ch, jhs@mojatatu.com, Nicolas Dichtel Subject: [PATCH net-next 3/4] ipmr: align RTA_MFC_STATS on 64-bit Date: Wed, 20 Apr 2016 10:57:34 +0200 Message-Id: <1461142655-5067-4-git-send-email-nicolas.dichtel@6wind.com> X-Mailer: git-send-email 2.4.2 In-Reply-To: <1461142655-5067-1-git-send-email-nicolas.dichtel@6wind.com> References: <20160419.195009.1052027353987244150.davem@davemloft.net> <1461142655-5067-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 Signed-off-by: Nicolas Dichtel --- include/uapi/linux/rtnetlink.h | 1 + net/ipv4/ipmr.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index ca764b5da86d..02baa5281bbf 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h @@ -312,6 +312,7 @@ enum rtattr_type_t { RTA_ENCAP_TYPE, RTA_ENCAP, RTA_EXPIRES, + RTA_PAD, __RTA_MAX }; diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 395e2814a46d..21a38e296fe2 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c @@ -2104,7 +2104,7 @@ static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb, mfcs.mfcs_packets = c->mfc_un.res.pkt; mfcs.mfcs_bytes = c->mfc_un.res.bytes; mfcs.mfcs_wrong_if = c->mfc_un.res.wrong_if; - if (nla_put(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs) < 0) + if (nla_put_64bit(skb, RTA_MFC_STATS, sizeof(mfcs), &mfcs, RTA_PAD) < 0) return -EMSGSIZE; rtm->rtm_type = RTN_MULTICAST; @@ -2237,7 +2237,7 @@ static size_t mroute_msgsize(bool unresolved, int maxvif) + nla_total_size(0) /* RTA_MULTIPATH */ + maxvif * NLA_ALIGN(sizeof(struct rtnexthop)) /* RTA_MFC_STATS */ - + nla_total_size(sizeof(struct rta_mfc_stats)) + + nla_total_size_64bit(sizeof(struct rta_mfc_stats)) ; return len;