net: nexthop: Adjust netlink policy parsing for a new attribute
authorPetr Machata <petrm@nvidia.com>
Wed, 6 Mar 2024 12:49:15 +0000 (13:49 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 8 Mar 2024 10:35:46 +0000 (10:35 +0000)
commit2118f9390d83cf942de8b34faf3d35b54f9f4eee
treed3d6ddc57d9f3045224f2e8d82949a7a6fe13a99
parent3b43f19d065d2e6669209f991bbf1522b351d0c4
net: nexthop: Adjust netlink policy parsing for a new attribute

A following patch will introduce a new attribute, op-specific flags to
adjust the behavior of an operation. Different operations will recognize
different flags.

- To make the differentiation possible, stop sharing the policies for get
  and del operations.

- To allow querying for presence of the attribute, have all the attribute
  arrays sized to NHA_MAX, regardless of what is permitted by policy, and
  pass the corresponding value to nlmsg_parse() as well.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/nexthop.c