All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Nikolay Aleksandrov <nikolay@nvidia.com>,
	Vivien Didelot <vivien.didelot@gmail.com>
Subject: [PATCH net 1/2] net: bridge: use nla_total_size_64bit() in br_get_linkxstats_size()
Date: Mon,  4 Oct 2021 18:05:07 -0700	[thread overview]
Message-ID: <20211005010508.2194560-2-eric.dumazet@gmail.com> (raw)
In-Reply-To: <20211005010508.2194560-1-eric.dumazet@gmail.com>

From: Eric Dumazet <edumazet@google.com>

bridge_fill_linkxstats() is using nla_reserve_64bit().

We must use nla_total_size_64bit() instead of nla_total_size()
for corresponding data structure.

Fixes: 1080ab95e3c7 ("net: bridge: add support for IGMP/MLD stats and export them via netlink")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Nikolay Aleksandrov <nikolay@nvidia.com>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
---
 net/bridge/br_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 6c58fc14d2cb2de8bcd8364fc5e766247aba2e97..29b8f6373fb925d48ce876dcda7fccc10539240a 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -1666,7 +1666,7 @@ static size_t br_get_linkxstats_size(const struct net_device *dev, int attr)
 	}
 
 	return numvls * nla_total_size(sizeof(struct bridge_vlan_xstats)) +
-	       nla_total_size(sizeof(struct br_mcast_stats)) +
+	       nla_total_size_64bit(sizeof(struct br_mcast_stats)) +
 	       nla_total_size(0);
 }
 
-- 
2.33.0.800.g4c38ced690-goog


  reply	other threads:[~2021-10-05  1:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05  1:05 [PATCH net 0/2] net: bridge: br_get_linkxstats_size() fixes Eric Dumazet
2021-10-05  1:05 ` Eric Dumazet [this message]
2021-10-05  9:03   ` [PATCH net 1/2] net: bridge: use nla_total_size_64bit() in br_get_linkxstats_size() Nikolay Aleksandrov
2021-10-05  1:05 ` [PATCH net 2/2] net: bridge: fix under estimation " Eric Dumazet
2021-10-05  9:04   ` Nikolay Aleksandrov
2021-10-05 11:50 ` [PATCH net 0/2] net: bridge: br_get_linkxstats_size() fixes patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211005010508.2194560-2-eric.dumazet@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@nvidia.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.