]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ipv4: nexthop: avoid duplicate NHA_HW_STATS_ENABLE on nexthop group dump
authorFernando Fernandez Mancera <fmancera@suse.de>
Thu, 2 Apr 2026 07:26:12 +0000 (09:26 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 3 Apr 2026 22:34:27 +0000 (15:34 -0700)
Currently NHA_HW_STATS_ENABLE is included twice everytime a dump of
nexthop group is performed with NHA_OP_FLAG_DUMP_STATS. As all the stats
querying were moved to nla_put_nh_group_stats(), leave only that
instance of the attribute querying.

Fixes: 5072ae00aea4 ("net: nexthop: Expose nexthop group HW stats to user space")
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20260402072613.25262-1-fmancera@suse.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/nexthop.c

index c942f12822363c68fc2bdb8a8f252028ab229380..a0c69458329940b74cc364951f7323d813e5cb8c 100644 (file)
@@ -902,8 +902,7 @@ static int nla_put_nh_group(struct sk_buff *skb, struct nexthop *nh,
                goto nla_put_failure;
 
        if (op_flags & NHA_OP_FLAG_DUMP_STATS &&
-           (nla_put_u32(skb, NHA_HW_STATS_ENABLE, nhg->hw_stats) ||
-            nla_put_nh_group_stats(skb, nh, op_flags)))
+           nla_put_nh_group_stats(skb, nh, op_flags))
                goto nla_put_failure;
 
        return 0;