]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: add a stricter length check
authorJakub Kicinski <kuba@kernel.org>
Wed, 16 Jun 2021 03:33:38 +0000 (20:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Jun 2021 07:40:44 +0000 (00:40 -0700)
commitc663206dd8e29565ad153e916a6af9906affefae
treed8c02b3d72f4e50d6f9ccc42f381bb075944cf66
parentce0fa2ea28a82abd9b0941b34845847a91d7baa8
ethtool: add a stricter length check

There has been a few errors in the ethtool reply size calculations,
most of those are hard to trigger during basic testing because of
skb size rounding up and netdev names being shorter than max.
Add a more precise check.

This change will affect the value of payload length displayed in
case of -EMSGSIZE but that should be okay, "payload length" isn't
a well defined term here.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/netlink.c