diff options
author | Jakub Kicinski <kuba@kernel.org> | 2020-10-05 15:07:35 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-10-06 06:25:55 -0700 |
commit | ff419afa43109e05d42d75629f21d9fd87f635ea (patch) | |
tree | aea540f88230add4ac90d08ca3d336a2a9a9deea /net/ethtool/tunnels.c | |
parent | 5028588b62cbda74744f4f28b35f618e5b1078ef (diff) |
ethtool: trim policy tables
Since ethtool uses strict attribute validation there's no need
to initialize all attributes in policy tables. 0 is NLA_UNSPEC
which is going to be rejected. Remove the NLA_REJECTs.
Similarly attributes above maxattrs are rejected, so there's
no need to always size the policy tables to ETHTOOL_A_..._MAX.
v2: - new patch
Suggested-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/tunnels.c')
-rw-r--r-- | net/ethtool/tunnels.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ethtool/tunnels.c b/net/ethtool/tunnels.c index 330817adcf62..48a52951917e 100644 --- a/net/ethtool/tunnels.c +++ b/net/ethtool/tunnels.c @@ -8,9 +8,7 @@ #include "common.h" #include "netlink.h" -const struct nla_policy -ethnl_tunnel_info_get_policy[ETHTOOL_A_TUNNEL_INFO_MAX + 1] = { - [ETHTOOL_A_TUNNEL_INFO_UNSPEC] = { .type = NLA_REJECT }, +const struct nla_policy ethnl_tunnel_info_get_policy[] = { [ETHTOOL_A_TUNNEL_INFO_HEADER] = { .type = NLA_NESTED }, }; |