Merge branch 'nexthop-more-fine-grained-policies-for-netlink-message-validation'
authorJakub Kicinski <kuba@kernel.org>
Thu, 21 Jan 2021 05:00:28 +0000 (21:00 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 21 Jan 2021 05:00:29 +0000 (21:00 -0800)
commit5ff96aec72190cab14a2edce8822e09497d6a70e
tree35d28e9237dc2d50675e5ce5dce1b1c72365f0c8
parent646188c9550f74454dfc172a347dad693e5bfc84
parent643d0878e674434e427888339e6d57c1cc25ee66
Merge branch 'nexthop-more-fine-grained-policies-for-netlink-message-validation'

Petr Machata says:

====================
nexthop: More fine-grained policies for netlink message validation

There is currently one policy that covers all attributes for next hop
object management. Actual validation is then done in code, which makes it
unobvious which attributes are acceptable when, and indeed that everything
is rejected as necessary.

In this series, split rtm_nh_policy to several policies that cover various
aspects of the next hop object configuration, and instead of open-coding
the validation, defer to nlmsg_parse(). This should make extending the next
hop code simpler as well, which will be relevant in near future for
resilient hashing implementation.

This was tested by running tools/testing/selftests/net/fib_nexthops.sh.
Additionally iproute2 was tweaked to issue "nexthop list id" as an
RTM_GETNEXTHOP dump request, instead of a straight get to test that
unexpected attributes are indeed rejected.
====================

Link: https://lore.kernel.org/r/cover.1611156111.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>