aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/genet/bcmgenet.c
diff options
context:
space:
mode:
authorPetr Machata <petrm@nvidia.com>2022-04-12 22:25:06 +0200
committerPaolo Abeni <pabeni@redhat.com>2022-04-14 09:01:26 +0200
commit23cfe941b52e2fa645bdfd770087128a74c7dbee (patch)
treec2890ee41df25a3c1d8e12e783aa8c93959d13b3 /drivers/net/ethernet/broadcom/genet/bcmgenet.c
parentnet: dsa: felix: fix tagging protocol changes with multiple CPU ports (diff)
downloadlinux-dev-23cfe941b52e2fa645bdfd770087128a74c7dbee.tar.xz
linux-dev-23cfe941b52e2fa645bdfd770087128a74c7dbee.zip
rtnetlink: Fix handling of disabled L3 stats in RTM_GETSTATS replies
When L3 stats are disabled, rtnl_offload_xstats_get_size_stats() returns size of 0, which is supposed to be an indication that the corresponding attribute should not be emitted. However, instead, the current code reserves a 0-byte attribute. The reason this does not show up as a citation on a kasan kernel is that netdev_offload_xstats_get(), which is supposed to fill in the data, never ends up getting called, because rtnl_offload_xstats_get_stats() notices that the stats are not actually used and skips the call. Thus a zero-length IFLA_OFFLOAD_XSTATS_L3_STATS attribute ends up in a response, confusing the userspace. Fix by skipping the L3-stats related block in rtnl_offload_xstats_fill(). Fixes: 0e7788fd7622 ("net: rtnetlink: Add UAPI for obtaining L3 offload xstats") Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://lore.kernel.org/r/591b58e7623edc3eb66dd1fcfa8c8f133d090974.1649794741.git.petrm@nvidia.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/broadcom/genet/bcmgenet.c')
0 files changed, 0 insertions, 0 deletions