]> git.baikalelectronics.ru Git - kernel.git/commit
nexthop: Assert the invariant that a NH group is of only one type
authorPetr Machata <petrm@nvidia.com>
Thu, 28 Jan 2021 12:49:16 +0000 (13:49 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Jan 2021 04:49:51 +0000 (20:49 -0800)
commit3dace0b83dbeb09c8d74bf48b16106c91fb82c5e
tree38307a1561dc0b97aad2394ba0d18352e61f211a
parentfff05261c1ea5ce7048b776177bca2059c90a54d
nexthop: Assert the invariant that a NH group is of only one type

Most of the code that deals with nexthop groups relies on the fact that the
group is of exactly one well-known type. Currently there is only one type,
"mpath", but as more next-hop group types come, it becomes desirable to
have a central place where the setting is validated. Introduce such place
into nexthop_create_group(), such that the check is done before the code
that relies on that invariant is invoked.

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