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)
commit4d1fb7cde0ccc6000cafb72d9079de1504e3cb2a
treed8c02b3d72f4e50d6f9ccc42f381bb075944cf66
parent1b3fc771769c9f9418b23dd5676ab25a215d247d
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